[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: concurrent access



Rolando Cantarutti writes:
 > In my threaded application I do not block the SIGIO signal in the rest of the
 > threads, but install the handler that is to handle the signal from within the
 > main thread. It works for me.

Yes, because signal handlers are shared between all threads. However,
you can't call any pthread_ functions from within your signal
handler. You can use semaphores though (although in the LinuxThreads
implementation, semaphores are not async-signal safe on Sparc and
386s).

My code works too if I don't block SIGIO, but that's just luck (and it 
certainly wouldn't work if I ported it to a different POSIX
platform). I think it ought to be possible to write code that is both
POSIX compliant and works on Linux in this case. 

 > Cheers,
 > R.Cantarutti

Will

-- 
Will Lockhart, System Developer, Axiom (Cambridge) Ltd.
http://www.mvhi.com/