delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/07/16/13:23:54

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Message-ID: <3B532313.3BB0051@etr-usa.com>
Date: Mon, 16 Jul 2001 11:23:31 -0600
From: Warren Young <warren AT etr-usa DOT com>
Organization: -ENOENT
X-Mailer: Mozilla 4.77 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
To: Corinna Vinschen <cygwin AT cygwin DOT com>
Subject: Re: fork()
References: <NEBBJCJLGLCEEOPGCDCEIEJICIAA DOT ronald AT landheer DOT com> <20010716152027 DOT U25442 AT cygbert DOT vinschen DOT de>

Corinna Vinschen wrote:
> 
> Your example is wrong. The output to stdout is line buffered. That means,

Another problem is, the code depends on the OS's multitasking
characteristics.  There's nothing explicit in the code that says the OS
has to take the time slice away from the parent or the child.  If you
threw in a line like this:

	if (rand() % 2) sleep(0);

after each print statement, you might reasonably expect randomness in
the output.
-- 
= Warren -- ICBM Address: 36.8274040 N, 108.0204086 W, alt. 1714m

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019