Signals and threads are not suited to work together?
Keith Smith wrote: > > This is a question I posed to comp.realtime, but noticed that you have a > discussion going on here…. can you offer me any assistance? > HEre’s the excert: > > Shashi: > > Based on your previous email (below), I have a couple of questions: > > 1. If signals and threads are not suited to work together, what > mechanism can/should be used to implement timing within a thread. If I > have two threads that performed autonomous time-based functions, I want > to be able to have a per-thread timing mechanism. > > 2. If the approach of “block all signals on all threads and send various > signals to a process – putting the emphasis on the thread to unblock the > appropriate signals”, how do we deal with other threads which may be > interrupted by a blocked signal (e.g. a read() call that returns EINTR > even when its thread blocks the offending signal. Isn’t this a flaw? > This requires the need for a signal handler (wastefull) with the RESTART > option speicified. > > I