[Top][All Lists]
[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: |
Mike Frysinger |
Subject: |
Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions |
Date: |
Fri, 13 Jan 2012 18:39:23 -0500 |
User-agent: |
KMail/1.13.7 (Linux/3.2.0; KDE/4.6.5; x86_64; ; ) |
On Friday 13 January 2012 17:41:17 Dave Platt wrote:
> [This particular problem bit me badly when I was debugging software
> which was running on an old embedded Linux kernel, which did not
> implement pselect() in the kernel. Instead, glibc has a "convenience
> implementation" of pselect() - which simply changes the signal mask
> and calls select(). In other words, the glibc code re-introduces
> the very timing race condition that pselect() was intended to cure...
> and it resulted in our system hanging at boot in an unpredictable
> fashion.]
glibc has to provide a POSIX API to the apps compiled against it. if the
kernel glibc is running on cannot provide the corresponding functionality, it
often has fallback logic to emulate it as best it can. in this case,
pselect() cannot be implemented completely in userspace ... it requires kernel
support to be bulletproof.
i'm not sure what else you can reasonably expect glibc to do ... certainly
calling abort() is worse imo.
-mike
signature.asc
Description: This is a digitally signed message part.
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, (continued)
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, Håkan Johansson, 2012/01/14
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, Mike Frysinger, 2012/01/14
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, Eric S. Raymond, 2012/01/14
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, Greg Troxel, 2012/01/14
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, Eric S. Raymond, 2012/01/14
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, Greg Troxel, 2012/01/14
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, Eckhart Wörner, 2012/01/14
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, Eric S. Raymond, 2012/01/14
- Re: [gpsd-dev] [PATCH] Use pselect() to reduce wakeups and avoid race conditions, Dave Platt, 2012/01/13