From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,99d1c7838ad3b215 X-Google-Attributes: gidf678f,public From: twd@cs.brown.edu (Tom Doeppner) Subject: Re: threads & asynch signals Date: 1996/01/04 Message-ID: <4ch34n$c4g@cocoa.brown.edu>#1/1 X-Deja-AN: 134079603 references: <820765792snz@wsl.co.uk> organization: Brown University Department of Computer Science newsgroups: comp.unix.osf.misc In article <820765792snz@wsl.co.uk> dcb@wsl.co.uk writes: > >Hello there, > >Threads and asynch signals don't seem to mix. To quote the man page, > >In a multi-threaded environment, the sigaction function should only >be used for the synch signals. > >Does anyone have any idea how one is supposed to write a real time >application (ie uses SIGALRM and has a handler for it), and use >the pthreads feature, on this *wonderful* OSF 3.2 ? > >There's a free beer in it. You might use sigwait: mask off SIGALRM throughout the process, then create a thread that calls sigwait, with SIGALRM set in the argument mask. The thread will block in the sigwait call and return only when a SIGALRM occurs. It's a much cleaner way of doing things than with signal handlers. Tom Doeppner Brown University twd@cs.brown.edu