tech-kern archive

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

Re: swapcontext() around pthreads

On Thu, Aug 09, 2012 at 08:47:51PM +0200, Martin Husemann wrote:
 > On Thu, Aug 09, 2012 at 08:44:05PM +0200, Emmanuel Dreyfus wrote:
 > > setjmp and longjmp are claim to not match the requirement because they
 > > do not allow different stacks for each execution context.
 > But there is a strong correlation between thread and stack, you can not
 > switch one without the other. So what is the intended semantics if you
 > setcontext() in thread A with a context created by thread B while B is
 > currently running on another CPU?

Probably that the entire operating environment of B is cloned and run
in thread A, that is, that it's a magic implementation of threaded

David A. Holland

Home | Main Index | Thread Index | Old Index