Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Methods for Asynchronous IPCby Gloom (Monk) |
on Feb 02, 2001 at 16:19 UTC ( [id://55986]=note: print w/replies, xml ) | Need Help?? |
It can be clever to use Light Weigth Processes ( LWP ).
LWP allow you to execute child processes in the same address space than their parents. In order to make this, you have to use the clone() syscall. This kind of processes can be called "Threads". By the way, I don't know how perl implements neither the use of threads ( if it does ) nor the clone syscall. I ask the monks : did perl allow multithreaded programmation ? Update : There is a module called "Thread" that provide you basis functions to implement a parallel processing and shared variables management ( Semaphores... ). Main process share global vars with the childs. Each of it can thus freely store a report, and main thread can process it. You may also use signal IPC to inform main process of its child's state. Hope this helps ( and I'm not too boring :)
In Section
Seekers of Perl Wisdom
|
|