[Spread-users] Spread and fork ()

Yair Amir yairamir at cnds.jhu.edu
Wed Nov 24 08:29:53 EST 2004


Hi,

It seems to me that the following code MAY work and the parent will not 
lose messages. I checked this briefly and I don't see a reason for it 
not to work. You will need to make SP_kill (which is an internal Spread 
library call) declared in the sp_funcs.h

Comments ?

---------------------------------------
parent_spread_handle = spread.connect(...)
parent_spread_handle.join()

...

os.fork()

if child
	SP_kill(parent_spread_handle)
	child_spread_handle = spread.connect(...)
	child_spread_handle = spread.join(...)

	rest of child code

otherwise // parent
	carry on your merry way
-----------------------------------------

Cheers,

	:) Yair.

J C Lawrence wrote:
> On Tue, 23 Nov 2004 18:26:26 -0500
> George Schlossnagle <george at omniti.com> wrote:
> 
> 
>>That should be safe.  What's unsupported is:
> 
> 
>>spread_handle = spread.connect(...)
>>os.fork()
>>spread_handle.join(...)
>># carry on our merry way
> 
> 
> Right then.  That just leaves a potential race condition for me to
> resolve in terms of messages sent during the window between the
> disconnect and the (re-)connect on the other side of the fork().
> 
> Hurm.
> 
> --
> J C Lawrence
> ---------(*)                Satan, oscillate my metallic sonatas.
> claw at kanga.nu               He lived as a devil, eh?
> http://www.kanga.nu/~claw/  Evil is a name of a foeman, as I live.
> 
> _______________________________________________
> Spread-users mailing list
> Spread-users at lists.spread.org
> http://lists.spread.org/mailman/listinfo/spread-users
> 




More information about the Spread-users mailing list