1

I found that on HPUX, a SIGALRM signal can be created by system and captured by process correctly in a single thread application. However, if I set SIGALRM in a thread, the SIGALRM will not happen anymore. Why? This issue only occurs on HPUX platforms, but works well on other UNIX platforms(solaris sparc,x86, Linux, AIX, Mac and Ubantu)

please help me out! thanks!

mwjohnson
  • 661
  • 14
  • 26

1 Answers1

-1

Signal Handling in Multithreaded Environments: As Signal Handler: For all UNIX platforms, signal handlers are installed on a per-process basis. In a multithreaded environment, there is only one signal handler for each signal within a process. The last signal handler installed for any thread is valid for all threads in the process. The handler is called when the signal is delivered.

Also the SIGALRM is the Asynchronous Signals generated by events outside the control of the process that receives them, and arrive at unpredictable times. As Asynchronous signals are delivered to the process not to Thread without regard to the instruction that is executing. That's why SIGALRM cann't happen in thread on HPUX.

This is in HP-UX scheduling policies; there are Signal Processing Notes of HP-UX.

suneet saini
  • 592
  • 3
  • 16