In article ,
Dennis Lee Bieber wrote:
>On Wed, 25 Nov 2009 13:52:09 -0800 (PST), Sandy
>declaimed the following in gmane.comp.python.general:
>>
>> Sometimes (very rare) it prints something like this:
>> ab
>> c
>> d
>> e
>
> Not
>
>ab
>
>c
>d
>e
>
>?
That's what I would guess, too.
>
Sandy wrote:
Hi all,
I am a little bit confused about os.fork().
Say I have the following code.
import os
a = ['a','b','c','d','e']
for i in xrange(len(a)):
pid = os.fork()
if not pid:
print a[i]
os._exit(0)
From most of the tuts and examples I saw online, I expect it
Sandy schrieb:
Hi all,
I am a little bit confused about os.fork().
Say I have the following code.
import os
a = ['a','b','c','d','e']
for i in xrange(len(a)):
pid = os.fork()
if not pid:
print a[i]
os._exit(0)
From most of the tuts and examples I saw online, I expect it
Hi all,
I am a little bit confused about os.fork().
Say I have the following code.
import os
a = ['a','b','c','d','e']
for i in xrange(len(a)):
pid = os.fork()
if not pid:
print a[i]
os._exit(0)
>From most of the tuts and examples I saw online, I expect it to print
a,b,c,