uClibc, linuxthreads, and uClinux

John Williams jwilliams at itee.uq.edu.au
Mon Jul 17 00:58:22 UTC 2006


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?
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'm trying to weigh up the effort/benefit in merging this into a uClinux-dist /
NOMMU build.

Any comments or thoughts appreciated,

John



More information about the uClibc mailing list