Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel!gatech!howland.reston.ans.net!Germany.EU.net!EU.net!chsun!hslrswi!news
From: dbrunner@hasler.ascom.ch (Dierk Brunner)
Subject: Re: Anyone implemented Futures in VisualWorks
X-Nntp-Posting-Host: voyager.hasler.ascom.ch
Message-ID: <1995Mar17.120639.26197@hasler.ascom.ch>
Sender: news@hasler.ascom.ch
Reply-To: dbrunner@hasler.ascom.ch
Organization: Ascom Hasler AG, Berne, Switzerland
References: <peter_korp-1603951124430001@groomlake.dis.anl.gov>
Date: Fri, 17 Mar 1995 12:06:39 GMT
Lines: 31

In article 1603951124430001@groomlake.dis.anl.gov, peter_korp@anl.gov (Peter A. Korp) writes:
>
>I have tried a simple implementation that causes the object engine to blow
>up(ie. Segmentation Fault) in the "futureObj become: realObj". As long as
>I keep the future object as a proxy that delegates all calls to the real
>object and don't make the call to become everything seems to work ok.
>
>Any pointers or tips appreciated.
>
>Peter


An example of futures for Digitalk Smalltalk can be found in the Journal of
Object-Oriented Programming, October 1993, page 69. If you want to port this
example to VisualWorks you cannot use #become:, because VisualWorks swaps the
object pointers while Digitalk simply redirects all pointers to another object.

Maybe you have some problems because of this pointer swapping. For example if
the result of the evaluation is nil and you do "futureObj become: nil" your
image will crash, because nil will be swapped with your future object and all
nils in your image will become that future object.

	Dierk Brunner


------------------------------------------------------
Dierk Brunner / NME3, Ascom Hasler AG, Belpstrasse 37,
    CH-3000 Berne 14, Switzerland, +41 31 999 2063
------------------------------------------------------


