[lkml]   [2009]   [Oct]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] RFC: futex: make futex_lock_pi interruptible
Chris Friesen wrote:
> On 10/29/2009 07:45 PM, Darren Hart wrote:
>> This appears to work fine. Can anyone think of a reason why this is an unsafe
>> thing to do? I'll have to create a much more elaborate test case and review
>> the glibc code of course to make sure the glibc mutex state isn't compromised.
> Setting aside the specific code details, I would suggest that you not
> review the glibc code but rather review the glibc documentation and the
> susv3/posix specifications. That way, if it behaves according to the
> spec but breaks glibc you can push for a patch to glibc.
> If it happens to work with current glibc but is not standards-compliant,
> then it could break in the future.

Unfortunately, pthread_mutex_lock() by spec shall not return -EINTR nor
is it a valid pthread_cancelation point. We can do the latter with a
non-posix extension in glibc. In order to provide an
interruptible/cancelable mutex, we would also be non-posix - at least,
if we provided a mechanism directly within glibc.

If folks think this signal based approach is the why to go, then you are
correct, we just need to make sure that the spec allows us to use
set/longjmp in this context.

Darren Hart
IBM Linux Technology Center
Real-Time Linux Team

 \ /
  Last update: 2009-10-31 01:33    [W:0.068 / U:22.716 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site