Michael Schnell wrote:
> 
> >in our context of Linux and doing it right, 
> >TLS is the way to go
> But if the port does not have it.....
> 
> (I want to port a multithreaded program from a propriety OS and as the 
> Linux interprocess sync is slow, I hoped to be able to do a user-land 
> inter-thread sync based on Futex. But now I find: no Futex, no fast way 
> to get a thread ID. Quite frustrating....)

Actually you can use raw futexes if you're prepared to write your own
mutexe.  That doesn't use any thread library.  It's just a system
call.  It's how futex was used originally, and it's still used that
way for some things.

You might be able to copy the NPTL mutex code, rename the functions
and use it in your own program - maybe from an older version, which
doesn't need the kernel to support futex atomic ops.  (Those were
added later as an optimisation).

Before jumping to conclusions about speed, try measuring the speed of
pthread_getspecific and pthread_self.

-- Jamie
_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to