Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

With LinuxThreads, I can no longer use the signals SIGUSR1 and SIGUSR2 in my programs! Why?

0
Posted

With LinuxThreads, I can no longer use the signals SIGUSR1 and SIGUSR2 in my programs! Why?

0

The short answer is: because the Linux kernel you’re using does not support realtime signals. LinuxThreads needs two signals for its internal operation. One is used to suspend and restart threads blocked on mutex, condition or semaphore operations. The other is used for thread cancellation. On “old” kernels (2.0 and early 2.1 kernels), there are only 32 signals available and the kernel reserves all of them but two: SIGUSR1 and SIGUSR2. So, LinuxThreads has no choice but use those two signals. On recent kernels (2.2 and up), more than 32 signals are provided in the form of realtime signals. When run on one of those kernels, LinuxThreads uses two reserved realtime signals for its internal operation, thus leaving SIGUSR1 and SIGUSR2 free for user code. (This works only with glibc, not with libc 5.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123