Subj : Re: Threads and signals To : comp.programming.threads From : Giancarlo Niccolai Date : Fri Jan 14 2005 11:45 pm Marcin 'Qrczak' Kowalczyk wrote: > When a signal is sent to a process by kill(), or is generated by > setitimer(), which thread handles it? > > I couldn't find it in SUSv3. On Linux with NPTL only the main thread > seems to receive it. > > sigprocmask must be used only in single-threaded programs, right? > But pthread_sigmask brings a dependency on pthreads. Does it mean > that it's impossible to write code which blocks signals temporarily, > doesn't create a dependency on pthreads, but if it's linked with > another library which uses pthreads then they still work? > Use an indirection layer. You need a middle level library (or dll, or loadable object) which CAN be linked with or without pthreads, and then your app will link with that one (or in case of dynamic loading, will just dload it). Bests Giancarlo. .