Re: Realtime safe signalling?



On Tue, Feb 01, 2005 at 15:48:36 -0500, Paul Davis wrote:
> >Is it OK to use Glib::Dispatcher::emit() in a realtime safe function, or
> >will that block when writing the signal to the pipe? Is there any other
> >way to send signals between threads (except using a semaphore and a
> >timeout signal in the GUI thread that checks it)?
> 
> no. none of these mechanisms are safe.
> 
> you need to to use some kernel facility (FIFOs are my favorite) to do

And what do you think Glib::Dispatcher::emit() is using?? Right, FIFOs.
Be sure not to share one dispatcher between several threads though as it
does some locking.

> this, and even that is not strictly realtime safe (its better if the
> FIFOs are in a tmpfs file system, for example).

It does not matter in what filesystem (if any -- see pipe(2)) the fifo
is in, because the inode is always in "pipefs". What does matter is to
make that fifo non-blocking (see fcntl(2)).

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb ucw cz>

Attachment: signature.asc
Description: Digital signature



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