tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: [PATCH] swapcontext vs libpthread



In article <20120822170050.GJ2326%homeworld.netbsd.org@localhost>,
Emmanuel Dreyfus  <manu%netbsd.org@localhost> wrote:
>-=-=-=-=-=-
>
>Here is an updated patch for sorting out swapcontext with libpthread,
>with documentation and test cases.
>
>I would appreciate feedback on LWP_PRESERVETLS flag to _lwp_create().
>This tells the kernel that the TLS base register will be used by 
>libpthread and that setcontext() should leave it untouched. 
>
>This is done in kernel because it seems to be the easiest way: 
>another approach would be to have libpthread overriding setcontext(),
>but that seems a bad choice: after unsetting _UC_TLSBASE it needs
>to call the real setcontext, which means doing a system call from
>libpthread. That looks wrong.

Why do you say that? pthread_cancelstub.c does exactly this (wrapping
a syscall and calling it) all the time. I don't think we should be
getting the kernel involved with this.

christos



Home | Main Index | Thread Index | Old Index