NVIDIA and TLS

Terry Lambert tlambert2 at mindspring.com
Thu Jun 19 00:14:24 PDT 2003


Daniel Eischen wrote:
> One question.  How does using %gs work in libc_r?  Thread switches
> in libc_r use setjmp()/longjmp() neither of which save and restore
> %gs.  If OpenGL sets %gs, libc_r will not change it when threads are
> switched.
> 
> Is NVIDIA's OpenGL suppose to be thread-safe for libc_r?  I don't
> see how it can be.  What am I missing?

1)	No other users of %gs.

2)	Thread running at the time of involuntary preemption is
	the thread that gets resumed on the next quantum, with
	no regard to thread priority.

3)	No one (mostly) does a lot of work in signal handlers.

It's not so much that it works on purpose as that it works by
serendipity.

-- Terry


More information about the freebsd-threads mailing list