Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!news2.near.net!howland.reston.ans.net!spool.mu.edu!torn!nott!cunews!tina.mrco.carleton.ca!knight
From: knight@mrco.carleton.ca (Alan Knight)
Subject: Re: Anyone implemented Futures in VisualWorks 2.0?
Message-ID: <knight.795551362@tina.mrco.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Reply-To: knight@mrco.carleton.ca (Alan Knight)
Organization: The Object People
References: <peter_korp-1603951124430001@groomlake.dis.anl.gov> <16MAR199515551864@pavo.concordia.ca> <3kebdp$3lq@mc1.mcnet.ch>
Date: Sat, 18 Mar 1995 18:29:22 GMT
Lines: 32

In <3kebdp$3lq@mc1.mcnet.ch> "Klaus D. Witzel" <Klaus.Witzel@com.mcNet.CH> writes:

>In article <16MAR199515551864@pavo.concordia.ca> ca_rovi@pavo.concordia.ca (ROVIRA, CHARLES-ANDRE) wrote:

>> 'become:' is a Smalltalk programming no-no.
>> It really screws things up royally (as you have become aware)
>> and performance
>> really takes a hit as every reference to the object has to be
>> updated to the other object, possibly involving a walk through
>> memory. (If its virtual, you're dead...)

>The implementation of the become: method simply swaps the memory 
>references of the two object pointers in the object table, and does
>not search memory for references as Charles said. See ST80: The
>Language and its Implementation.  Question: Have things changed
>meanwhile?

It depends on your implementation. ParcPlace uses an extra layer of
indirection in all their object references. This allows a cheap and
quite easy become: operation (although there's more fiddling with the garbage
collector than just switching two references)

Digitalk, which I think Charles is talking about, uses direct object
references. This is faster in general, but makes become: an extremely
expensive operation (and one-way instead of two-way). I've also heard
that become: can be unreliable in some Digitalk implementations.

-- 
 Alan Knight                | The Object People
 knight@acm.org             | Smalltalk and OO Training and Consulting
 alan_knight@mindlink.bc.ca | 509-885 Meadowlands Dr.
 +1 613 225 8812            | Ottawa, Canada, K2C 3N2
