Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3C9B1A4D.32EE2167@axlog.fr> Date: Fri, 22 Mar 2002 11:49:33 +0000 From: Stephane Corbe X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.8 sun4u) X-Accept-Language: fr, en MIME-Version: 1.0 To: cygwin AT cygwin DOT com Cc: al AT axlog DOT fr Subject: Time sharing and fork References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Hello, Because my problems with fork and DLL continue, I tried to remove DLL and to test only fork. And Cygwin had a really different behavior than unix has. With the programm below I have 1000 times "Je suis le fils" and then 10000 times "Je suis le pere" or the reverse sometimes. Under my solaris the sentence switch after about 800 outputs. (See the output traces at the end of mail) I tried sched_setsched function too, (for SCHED_OTHER) but they seems not implemented. Is there a way to set the priority of the fork processes ??? Stephane #include #include #include int main(void) { int probe_pid, i; printf("before fork\n"); probe_pid = fork(); printf("after fork %d\n", probe_pid); switch (probe_pid) { case 0 : for (i=0; i<10000; i++) { printf("%d> Je suis le fils %d\n", probe_pid, i); } break; case -1 : printf ("Erreur fork\n"); exit(-1); break; default: for (i=0; i<10000; i++) { printf("%d> Je suis le pere %d\n", probe_pid, i); } break; } return 0; } Output : (On Cygwin 1.3.10-1 NT4) before fork after fork 343 343> Je suis le pere 0 343> Je suis le pere 1 ... 9999> Je suis le pere 9999 after fork 0 <----------- See where the child begins 0> Je suis le fils 0 0> Je suis le fils 1 ... 9999> Je suis le fils 9999 -- 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/