Bug 6800 - sem_post does not properly wake waiting thread
Summary: sem_post does not properly wake waiting thread
Status: NEW
Alias: None
Product: uClibc
Classification: Unclassified
Component: Threads (show other bugs)
Version: 0.9.34
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-14 21:20 UTC by Jeff Hansen
Modified: 2014-01-14 21:20 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Proof of bug (1.11 KB, text/x-csrc)
2014-01-14 21:20 UTC, Jeff Hansen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Hansen 2014-01-14 21:20:21 UTC
Created attachment 5186 [details]
Proof of bug

In the attached example (without USE_FUTEX defined), the "^^ got in" text does not ever print out as expected, on x86 and MIPS architectures.  This is very problematic in applications post them immediately wait, where other threads need to be allowed a sliver of time in between.

If you use raw Linux futex syscalls, Linux properly wakes up the last waiting thread so that "^^ got in" prints out, as shown by defining the USE_FUTEX macro.