delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/09/06/00:43:28

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
MIME-Version: 1.0
Message-Id: <f-9IOQ9IgenIw_M@aport2000.ru>
X-Originating-Ip: [62.76.160.202]
Subject: cygwin implementation of fork() eating all resourses?
From: Artem Gluhov <argl AT aport DOT ru>
Date: Mon, 06 Sep 2004 08:42:56 +0400
To: cygwin AT cygwin DOT com

After 5 minutes running this script  i got a windwows XP 
error: not enough system resourses.

<----------------------
#!/bin/bash
while (( 1 )); do
  ls > /dev/null;
done;
---------------------->

This program leads to the same result:

<------------------------- 
#include <sys/types.h>
#include <unistd.h>

int main() {
    bool fl = true;
    while ( fl ) {
	pid_t child_pid = fork();
	if ( child_pid != 0 ) {
	    //parent process, continue loop ...
	    fl = true;	    
	} else {
	    //child process, exit loop ...
	    fl = false;   
	};//end if
    };//end while
}
----------------------------->

At normal linux systems this code works well ... Is it a 
bug?

P.S. Sorry for my bad english.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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