Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Solved: WAProcess>>critical:ifError problem

1 view
Skip to first unread message

Sebastian

unread,
Aug 22, 2008, 4:47:40 PM8/22/08
to
Hi there,

in reference to

http://groups.google.com/group/comp.lang.smalltalk.dolphin/browse_thread/thread/eef5f8b8f5299947/44f04d0252c5142b?lnk=gst&q=WAProcessMonitor#44f04d0252c5142b

and after two days of pain I've finally found a solution for that
problem: making the response an instVar so the continuation wont
overwrite the result as nil.

I have not found final evidence but all I've seen indicates that
continuations in Squeak and VisualWorks have some sort of compensation
effect for temps which Dolphin has not. So they wont overwrite the
temp which receives the answer of the block evaluation with nil as
Dolphin does.

The code I'm using now is

WAProcessMonitor>>critical: aBlock ifError: anErrorBlock
^ mutex critical:[
semaphore := SeasidePlatformSupport semaphoreClass new.
process := [[response := aBlock on: Error do: anErrorBlock]
ensure: [semaphore signal]] fork.
semaphore wait.
process := nil.
response].

For the record the previous was:

| value |

mutex critical:
[process := Processor activeProcess.
[value := aBlock on: Error do: anErrorBlock] ensure: [process :=
nil]
].
^ value

which is a workaround which uses more than 400% of additional RAM
unnecessarily (because the continuation will copy the process to its
born far there in swazoo). That fork is cutting the copy just where it
is needed (a pity those subtleties aren't documented).

I hope this is one problem less for Dolphin Seasiders,

Cheers,

Sebastian

Malbs

unread,
Aug 26, 2008, 10:16:33 PM8/26/08
to
Nice find/fix!


Sebastian

unread,
Aug 27, 2008, 8:36:14 AM8/27/08
to
On Aug 26, 11:16 pm, "Malbs" <ssefl...@somewhere.com> wrote:
> Nice find/fix!

Subject magic ;)

Also check:

http://groups.google.com/group/comp.lang.smalltalk.dolphin/browse_thread/thread/76cec006baaebf80?hl=en#

cheers,

Sebastian

macta

unread,
Aug 28, 2008, 3:50:37 PM8/28/08
to
Sebastian <ssa...@seaswork.com.ar> wrote:

> and after two days of pain I've finally found a solution for that
> problem: making the response an instVar so the continuation
> wontoverwrite the result as nil.

Any chance you could put your Seaside corrections into the global repository that David has now provided?

We need to get better at having a global place with all latest fixes (I'm equally guilty as well)

Tim
--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo

0 new messages