Hi, all!

I know Space.merge does not synchronize on stability of the space to be merged
but I was a bit shocked how differently my program behaved depending on whether
I explicitly synchronized on stability before merging.

Try the following example (should be fed in steps according to comments):

% First feed from here...
declare
Synch = {NewCell _}
Svc = {Service.synchronous.newFun fun {$} {Wait @Synch} Synch := _
                                     o(1 2)
                                  end}
S1 = {Space.new fun {$} {Svc} end}
{Browse {Space.askVerbose S1}}
{Browse thread {Space.ask S1} end}
% ... to here. Second feed from here...
declare
S2 = {Space.new proc {$ X} Rec = {Space.merge S1} in
                   {Wait Rec}
                   X = Rec.(choice 1 [] 2 end)
                end}
{Browse thread {Space.ask S2} end}
% ... to here. Third feed from here on.
@Synch = unit
{Browse {Space.ask S2}}
{Browse {Space.merge S2}}

My question is: if S1 is suspended and _not_ succeeded(stuck), should S2 become
succeeded by merging it? What's more: if a top-level thread merges S2, it will
block forever. That's what happened to my application, where S2 was one of the
intermediate spaces produced during search.

Or the moral is that, when you say that Space.merge does not synchronize on
stability, you mean it should only be applied to stable spaces?

Thanks in advance. Cheers,

Jorge.


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to