Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inter-thread communication in PERL?

Status
Not open for further replies.

lichtjiang

Programmer
Feb 26, 2007
39
US
How threads communicate in perl? For example, if there are 3 threads, A, B, C. C needs to know when A and B finish so that it terminates afterwards. How can C know such status info nicely? I guess there are two ways theoretically. One is gets status info from each other thread. And the other is to get this from the process that creates these threads. Any thought? Thanks a lot!
 
I guess you could do this multiple ways.. the easiest would be to just run a & b from a parent program and then have the parent run C when A & B are done. If not you could just write out log files and have C check to see if A&B are done. If they need to really communicate together you could use shared memory. With out more information I'm not sure which way to direct you.

Travis
 
Thanks!

I guess most IPC methods will do with aid of semaphores for real-time communication. But is there a way to attach a real (I mean a one used by OS that an interrupt can be sent immediately. The one found in CPAN only simulates this and is thus not a real SIGNAL I guess) SIGNAL handler to a thread?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top