Re: Issues and doubts about ithreads
[email protected] (Elizabeth Mattijsen)
| Newsgroups | perl.ithreads |
|---|---|
| Message-ID | <f06110410be1957c2ab3d@[192.168.56.3]> |
At 12:18 PM -0300 1/21/05, Martín Ferrari wrote: >Also, I found today the Elizabeth Mattijsen's forks.pm module, and >read that it uses TCP communication (why not UNIX, or -again- mmap?). Patches are welcome. ;-) Also: I''ve recently become to appreciate memcached, and was wondering whether that would be a good alternative for setting and fetching shared values. Unfortunately I don't have the tuits until at least the beginning of March. >I read a little of the code but couldn't understand anything :). Is there anything in particular that you don't understand more than the rest? >I'm very worried about performance issues, and some hints would be useful >before deciding what to use for the project. Using TCP/IP will add latency and some CPU overhead to your inter-thread communication. How this offsets with using a lot less memory, is really dependent on your situation. Basically I would say, don't expect forks.pm to be faster than threads once threads have started. On the other hand, for any serious program (with any serious number of modules loaded), there's a good chance that forks.pm will be faster in starting a thread. >Having spent many hours trying to figure out what to do, there is very >little stopping me from trying a complete C solution, but that would >be painful! Please, give me some hints so I can still be a lazy perl >lover :) If speed is what you ultimately want, then C would be the way. If you don't need any inter-thread locking (which may happen in some applications), then maybe a fork / memcached combo would be a solution if you have a large amount of shared data. See Cache::Memcached on CPAN. Hope this helps. Liz