confused with os.fork()

Aahz aahz at pythoncraft.com
Thu Dec 3 16:48:42 EST 2009


In article <mailman.997.1259210013.2873.python-list at python.org>,
Dennis Lee Bieber  <wlfraed at ix.netcom.com> wrote:
>On Wed, 25 Nov 2009 13:52:09 -0800 (PST), Sandy <dksreddy at gmail.com>
>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.

>	Since all the forked processes are sharing the same output device,
>it is quite possible that their output is getting interleaved.

Actually, I am a tiny bit surprised; I would have expected that a single
output call at the C level would not get interleaved.  Of course, it's
quite likely that the string and the \n are separate API calls.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

The best way to get information on Usenet is not to ask a question, but
to post the wrong information.  



More information about the Python-list mailing list