| Store | Cart

RE: thread limit in fork?

From: Edwards, Mark \(CXO\) <Mark...@hp.com>
Tue, 26 Nov 2002 06:45:20 -0700
I'm *really* confused now.  I've read topic after topic on this list
saying that fork doesn't work on Windows.  I've tried some trivial
examples and it work.  Other's have written that it works in some case
but not all.  One note said that a program worked most of the time but
occasionally gets all forked up.  What's the official word on 5.6.1
(build 633).

-----Original Message-----
From: Jan Dubois [mailto:j...@ActiveState.com] 
Sent: Monday, November 25, 2002 16:45 PM
To: prefab
Cc: perl...@listserv.ActiveState.com
Subject: Re: thread limit in fork?
Importance: Low


On Mon, 25 Nov 2002 15:09:26 -0800 (PST), prefab <pr3...@yahoo.com>
wrote:

>Does anyone know where this limit comes from and if it>is possible to configure a higher number of threads?

Yes, there is a limit of 64 *concurrent* threads in Perl on Windows.
The limit comes from using the WaitForMultipleObjects() API for the
implementation of the wait() function.  It would be possible to do
better by e.g. chaining multiple blocks of 64 handles together using
event semaphores, but somebody has to actually do it.  It is not as easy
as just changing a constant and recompiling the sources.  Patches
welcome! :)

Note that you must use wait/waitpid to reap your forked children.
Otherwise the slots in the thread table won't become available again for
new threads.

Cheers,
-Jan

_______________________________________________
Perl-Win32-Users mailing list Perl...@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Recent Messages in this Thread
Edwards, Mark \(CXO\) Nov 26, 2002 01:45 pm