gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race co


From: Eckhart Wörner
Subject: Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions
Date: Sat, 14 Jan 2012 14:07:59 +0100
User-agent: KMail/4.8 rc2 (Linux/3.2.0-8-generic; KDE/4.7.97; x86_64; ; )

Hi Håkan,

Am Samstag, 14. Januar 2012, 06:43:08 schrieb Håkan Johansson:
> Regarding (p)select and signal races, I did not see the 'self-pipe trick'
> mentioned in the discussion.  Quoting
> http://www.kernel.org/doc/man-pages/online/pages/man2/select.2.html:
> 
> "On systems that lack pselect(), reliable (and more portable) signal
> trapping can be achieved using the self-pipe trick (where a signal handler
> writes a byte to a pipe whose other end is monitored by select() in the
> main program.)"

I considered using that trick myself, but I refrained from doing so since the 
trick requires a lot of extra code and in general is not that easy to get 
right. [1] contains a discussion of all the steps required.

Eckhart

[1] http://lwn.net/Articles/177897/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]