[Spread-users] Spread and fork ()

George Schlossnagle george at omniti.com
Tue Nov 23 18:26:26 EST 2004


On Nov 23, 2004, at 5:17 PM, J C Lawrence wrote:

> On Tue, 23 Nov 2004 12:05:36 -0500
> John Schultz <jschultz at spreadconcepts.com> wrote:
>
>> Currently, Spread doesn't really support the fork() process model.
>
> Oh dear.
>
> In python terms (my application is written in Python), I've been
> assuming that I can safely do:
>
>   spread_handle.disconnect ()
>   pid = os.fork ()
>   if pid != 0: # Parent
>     spread_handle = spread.connect (...)
>     spread_handle.join (...)
>     ...etc
>   else: # Child
>     spread_handle = spread.connect (...)
>     spread_handle.join (...)
>     ...etc
>
> Is this unsafe?


That should be safe.  What's unsupported is:

spread_handle = spread.connect(...)
os.fork()
spread_handle.join(...)
# carry on our merry way

George





More information about the Spread-users mailing list