[M3devel] User-level threads using makecontext/getcontext/swapcontext
Tony Hosking
hosking at cs.purdue.edu
Fri Oct 23 20:43:59 CEST 2009
I have a (slightly rough) derivative version of ThreadPosix working on
I386_DARWIN (implemented more along the lines of the current
ThreadPThread) which abstracts all the nasty C-isms into
ThreadPosixC.c. I would like to propose that this become our updated
user-level threads implementation to complement ThreadPThread and
ThreadWin32, but doing so will require reworking the C code for the
other targets. My question is the following: which targets currently
default to ThreadPosix (instead of ThreadPThread)? Do those targets
all have makecontext/getcontext/swapcontext (or equivalents that might
be simulated with setjmp/longjmp)? I can make the effort to ensure
things work for SOLgnu/SOLsun, *_DARWIN, LINUXLIBC6, but don't have
easy access to existing ABIs for other targets. Can someone else do
that? The advantage of this move will be to eliminate a large swath
of "cloned" RTMachine and RTThread implementations and simplify
porting. If we are in agreement on this then I can begin to tidy up
and commit my changes. The advantage of retaining the user-level
threads code is its benefit as a live reference implementation of the
Modula-3 thread semantics.
Antony Hosking | Associate Professor | Computer Science | Purdue
University
305 N. University Street | West Lafayette | IN 47907 | USA
Office +1 765 494 6001 | Mobile +1 765 427 5484
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091023/40b5dd94/attachment-0001.html>
More information about the M3devel
mailing list