uClibc, linuxthreads, and uClinux

Peter S. Mazinger ps.m at gmx.net
Mon Jul 17 23:27:46 UTC 2006


On Mon, 17 Jul 2006, John Williams wrote:

> Hi,
> 
> [Cross-posting between uclibc and uClinux-dev, seems appropriate in this case]
> 
> I'm trying to debug what looks like a "live-lock" problem in a multithreaded
> uclinux app - MicroBlaze 2.4.x kernel, most recent non-test uClinux-dist
> snapshot from August last year.
> 
> According to the LinuxThreads FAQ, livelock is a known issue pre-0.8 if you have
> multiple threads, and use the SCHED_RR policy.  Basically, you can get thread
> (and kernel) starvation if you set a thread's policy to SCHED_RR and give it a
> non-zero priority.
> 
> This is almost certainly the problem I'm seeing, a SCHED_RR thread goes into a
> tight while(1); loop waiting for another thread to kill it, but the "reaper"
> thread never gets scheduled, and we have livelock.
> 
> In the most recent uClibc stable release 0.9.28 (and also in uClinux-dist),
> uClibc/libpthread/linuxthreads/README says "This is release 0.7 (late beta)".
> However, the FAQ.html in the same directory, mentions the livelock bug, saying
> it's fixed in LinuxThreads later than 0.8
> 
> So, it seems that the FAQ and README versions are a little skewed, for starters.
>  Maybe this was an artifact from whichever release of LinuxThreads was imported
> to uClibc waaaaay back when?
> 
> Looking next at the uClibc SVN repo, in trunk/uClibc/libpthread/linux_threads,
> it's not clear exactly which version of LinuxThreads is in there, because the
> README and FAQ etc are no longer present.
> 
> Browsing the SVN history I see that what is now called linuxthreads was imported
> by vapier on 31st Jan-06.

> I guess my questions are:
> 
> 0. Any clarifications to my interpretation of the history?
> 1. What is the version of LinuxThreads currently in SVN head of uClibc?

linuxthreads_old is the only usable in svn, the commit you mention is not 
functional.

> 2. Is it likely to fix the livelock problem?
> 3. Does it build/work?
> 4. Has it had any NOMMU work done on it?

I have ported some parts of NOMMU stuff from old linuxthreads to the new 
linuxthreads (that you mentioned committed to svn by vapier) and made it 
work. If you want to test it on NOMMU, I can provide you the changes, 
although only as big-patch-against-0.9.28 (it works on MMU x86 and ppc)
The new linuxthreads is based on the current freezed linuxthreads version 
in glibc (last released as 2.3.6)

Peter
 
> I'm trying to weigh up the effort/benefit in merging this into a uClinux-dist /
> NOMMU build.
> 
> Any comments or thoughts appreciated,
> 
> John
> 
> 

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2




More information about the uClibc mailing list