Multithreading problems
Khem Raj
khem at mvista.com
Wed Aug 2 14:31:24 PDT 2006
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
> 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
> 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.
> Why
> can I compile without linking pthreads?
thats a mystery you should know.
> Why does curl have problems in a
> thread but not when it's in main()?
curl is threadsafe as per their FAQ
http://curl.haxx.se/docs/faq.html#5.1
however they mention in multi-threaded environment, you
need to provide locking functions. which I think uclibc provides.
> Am I wrong in thinking that I would
> have fewer problems with NPTL?
>
I dont think that you will have your problem solved just by switching
the threading library.
> I know most of these questions can't be answered without knowing a lot
> more about my setup but is there anything major I'm overlooking? This is
> my first try at writing a multithreaded app and considering that uClibc
> threading is different from glibc there may be something I'm missing.
>
> Thanks in advance for any help.
>
> Marshall
>
>
>
>
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://busybox.net/cgi-bin/mailman/listinfo/uclibc
>
More information about the uClibc
mailing list