Multithreading problems

Marshall Crocker marshall at iconux.org
Wed Aug 2 22:50:46 UTC 2006


Khem Raj wrote:
> Marshall Crocker said the following on 08/02/2006 01:48 PM:
>> I did some digging in the uClibc emails and found out that the 
>> pthreads library is  linuxthreads  and not NPTL which explains why 
>> mutexes wouldn't work and also why I see several threads for my app 
>> instead of one.  I also saw that NPTL work is being done for uClibc 
>> and should be merged into the main NPTL tree.
>>   
> Well NPTL is another implementation of threading library. So I dont 
> see how it can be related to your problem

It probably isn't directly related to my problem but wouldn't that
explain why I'm seeing multiple threads  with different PIDs instead  of
a  single process for all threads?  As for mutexes, I see they should
work for linuxthreads but I was having problems with them before I
linked with -lpthreads.

>> So now for the questions:  the deadlock I was seeing could this be a 
>> result of not linking pthreads? 
> if you dont link with pthreads you should have got linking errors. how 
> were you able to link your code

That's what I thought and that's what happens if I compile the code for
my development machine.  The only thing I can guess is that uClibc
implements some kind of stub for pthreads?  That's the idea I get from
this email: http://uclibc.org/lists/uclibc/2006-July/015927.html

>> Actually, I am still seeing deadlock even with -lpthreads so maybe 
>> it's a problem with my semaphores?  
> Thats could be. You might have to debug it further.

I'm almost certain this is the problem.  Indeed, I need to do more
debugging.

>>  
> I dont think that you will have your problem solved just by switching 
> the threading library.

Agreed.  It's still a mystery to me as to why curl won't work in a
thread though.  I thought it might be a problem with the threads
library.  uClibc is configured to use the old linuxthreads so maybe I
should try with the new linuxthreads?  The deadlock issue is most likely
my fault though.

Marshall




More information about the uClibc mailing list