NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
how to fix ithreads (Score:1)
ithreads have two problems:
1. When you spawn a thread, it copies the whole environment from the parent thread, variables and code. This results in poor performance when a lot of libraries are loaded.
2. You can't pass a file descriptor from one thread to the other. So you can't create a network server that spawns a thread for each client.
This makes perl one of the only scripting language you can't use to build a multi-threaded network server, without using fancy stuff like Coro, AnyEvent or POE. Those are gr
Re:how to fix ithreads (Score:1)
Reply to This
Parent
Re: (Score:1)
Works great for that. How about starting ten threads, then passing them a filehandle to work on? That's what I was talking about.
Beside, if you have a lot of stuff loaded (like POE), instead of this trivial exemple, each thread spawn is rather costly.