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.

Cleaning up when kill signal is sent to the thread.?

cleaning kill sent signal thread
0
Posted

Cleaning up when kill signal is sent to the thread.?

0

> I’m writing a multi-threaded daemon, which requires some cleanup if a > kill signal is sent to the thread. I want just the thread that received > the signal to exit. > > The platform is Linux 2.0, libc 5.4.23, linuxthreads 0.6 (99% POSIX > threads). > > The docs indicate that threads share signal functions, but can > individually block or accept certain signals. This is workable — but > how do I get the thread id of the thread that received the signal? > > And my next question, how portable are thread cleanup routines? > > Thanks, > > Jeff Garzik Quality news feeds > News Administrator INN Technical info, Consulting > Spinne, Inc. http://www.spinne.com/usenet/ Jeff, From the sounds of what you say, the answer is “No.” 🙂 Meaning, don’t do that. There’s a better method, cancellation. If you really want the thread to exit asynchronously, that’s the way to do it. Now, it is even more likely that a simple polling routine will do the job, and that would be even easier to write. -Bil (Th

Related Questions

What is your question?

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

Experts123