Perllace has asked for the wisdom of the Perl Monks concerning the following question:
Inside this function, I have separate subroutines to handle each kind of information such as RAM, Heapinfo etc., I want each subroutine to run on a separate thread and retrieve the necessary information. How can I make this happen ? If I do it this way, only the cputhread output gets printed on the console.Obj->GetSystemInfo($s,$name,$App)
Thank you, Perllace$RAMthread = threads->new(sub{$self->GetFreeRAM($serial)}); $heapthread = threads->new(sub{$self->Getheap($serial)}); $cputhread = threads->new(sub{$self->Getcpu($serial)});
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to create separate threads for concurrent execution?
by BrowserUk (Patriarch) on Mar 14, 2011 at 10:12 UTC | |
|
Re: How to create separate threads for concurrent execution?
by ikegami (Patriarch) on Mar 14, 2011 at 17:49 UTC | |
|
Re: How to create separate threads for concurrent execution?
by BrowserUk (Patriarch) on Mar 14, 2011 at 17:35 UTC |