pthread_switch: fast user-level context switch
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 25 Apr 2014 23:29:04 +0000 (16:29 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Fri, 25 Apr 2014 23:32:48 +0000 (16:32 -0700)
commit0b940e7e2b89407be29e24510f2cf643eb774fe0
tree9da7b82425ce58cc8a39d89f4a9ef40b105e0c60
parent6ff3aa801622e2ad7d215134c5eef19332fdfc49
pthread_switch: fast user-level context switch

This is just an example of what you can do.  Be a little careful if you
use this in another 2LS, since it short-circuits the rest of
uthread_yield.  I think it is okay as is, but future uthread changes
could cause trouble.  If we really need this behavior, I could build it
in to uthread.c.

Also, this adds an interface to pthreads, such that you can create a
thread, but not start running it yet.  Careful with that, too.
tests/pthread_switch.c [new file with mode: 0644]
user/pthread/pthread.c
user/pthread/pthread.h