P is for Practical | |
PerlMonks |
Re: Threads or Forking?by cmeyer (Pilgrim) |
on Jul 29, 2005 at 00:10 UTC ( [id://479184]=note: print w/replies, xml ) | Need Help?? |
If you would like to share large amounts of read-only memory between the processes (read: threads or processes), then fork is your choice. Perl's ithreads implementation doesn't support truly shared memory, or COW (copy-on-write) shared memory. On the other hand, if you want to share large amounts of read-write memory, or if you want to share objects between the processes, then there is no reasonable option that I am aware of. The best option that I've found for communicating complex data structures between processes is serializing the data and printing it over a socket or pipe. The best option for sharing objects may be SOAP, RPC::PlServer, or something similarly obnoxious (or beautiful, depending on your point of view). I would love to learn that I am wrong about this. -Colin. WHITEPAGES.COM | INC
In Section
Seekers of Perl Wisdom
|
|