On Thu, Jun 21, 2001 at 12:32:08PM -0700, Dana Powers wrote:
> Perl does not currently support threads ( well ). This means that each
> thread must spawn its own interpreter. This is expensive and significantly
> slows down connection time. Perl 6 is *supposed* to be totally thread-safe,
> but chances are that MySQL will be on 5.0 before we seen anything stable
> from the perl6 camp ;).
You could give each thread it's own interpreter and keep that
interpreter around from one request to the next. Or share a pool of
interpreters to conserve memory.
There's a lot of work going in to this threading model
(interpreter-per-thread, or ithreads) right now by a fellow named Artur
Bergman (search the perl5-porters archives for "Artur" or "ithreads"
to get a handle on it). They're currently tackling the regexp piece.
ithreads was added by the fork() emulation ActiveState added for Win32
platforms, I think.
The real draw for this ithreads stuff, IMHO, is the nascent mod_perl 2.0
and it's support for Apache 2.0's multithreaded configurations.