At 11:39 -0500 3/21/03, Chen, Allen wrote:
Anyway, I'm very interested in Elizabeth's forks.pm module. I'm wondering how it compares to ithreads. I see that forks is much better with memory, but how about performance? Besides memory usage, is there any reason to use one over the other?
Reduced memory usage was _the_ reason for me to develop forks.pm as a proof of concept. But this is at the expense of performance, as all communication between threads (storing and fetching variables) is done using sockets. Although this is done on an open connection, this is still a significant overhead.
Other reasons for me to develop forks were:
- technically being able to run this with pre-5.8.0 perls so that people would not have to migrate to 5.8.X before being able to try Perl threads (so you could think of forks.pm as a tutorial module).
- possible expansion to running on different physical machines without having to abandon the API.
And one last question: will Thread::Queue and Thread::Semaphore work with forks.pm?
As both are just applications of shared variables, they should work, yes.
Liz
