in reply to Re^2: Data Between Threads
in thread Data Between Threads
On the threadA you are putting shift into $Qab. What is this doing? I am assuming it is to put the parameter into the sub's $Qab, but correct me if I am wrong.
Correct. A thread function is just a normal function that takes it arguments in the normal way.
Also what role does $Qab->enqueue( undef );
Once threadA has finished its loop; it queues undef before terminating. That undef causes the while loop in threadB to terminate; whence it then enqueues undef which cause the while loop in threadC to terminate.
|
|---|