[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: TLS support
On Sat, Nov 19, 2011 at 02:23:20AM +0100, Joerg Sonnenberger wrote:
> (1) Register a global variable with the kernel and write
> curlwp->l_private to that location before returning to userland.
> Pro: Relative simple modification of the return-from-trap logic.
> Con: Has to deal with traps. Requires work for every system call and
> context switch.
Why every system call, I'd have thought it would be enough
to do it on every context switch.
Well - every context switch when the correct pmap is loaded,
and every time the pmap is loaded.
Might be best to start of with a location on the stack registered
(to save the conditional).
The registered address could be saved in the pmap itself. Writing
out the value into the wrong pmap wouldn't matter! So you don't
need to care about which pmap is active when a lwp is scheduled!
David Laight: david%l8s.co.uk@localhost
Main Index |
Thread Index |