Agreed, unsafe signals aren't required. I definitely agree that refactoring this code may be the order of the day. The person was attempting to identify when worker threads which were told to finish up work, didn't finish up and a forceful exit occurs. Consider it to be like deadlock avoidance.
I boiled it down to a brain dead example to try and isolate exactly what was going wrong in the code, and ultimately determined it was the join() call. I created the equivalent C code, and found that pthread_join() doesn't block deliver of the SIGALRM. So, assuming that's actually what threads::join() is using (the guy over at SO realized he misspoke saying it was implemented with mutex_lock()), then it seems like I should get the same behavior out of perl. But, I'm assuming there's something with how signals are being delivered, or the layer of indirection in the interpreter calling out to pthread_join() that prevents the signal from being delivered in perl, where it is in C.
In reply to Re^2: Why does threads::join block SIGALRM
by CDahn
in thread Why does threads::join block SIGALRM
by CDahn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |