Thread support in 0.10 on OpenBSD

Robert S. Thau rst at ai.mit.edu
Tue Mar 31 18:28:44 PST 1998


Miller Abel writes:
 > If assembler is permitted, a simpler and more maintainable solution is
 > to use a single line of assembler to load the initial stack pointer
 > value when a thread is created. Then all that is required is
 > setjmp/longjmp. The jmp_buf structures are simply saved with the thread
 > data (and one for the scheduler context) and are neither inspected nor
 > modified.

The downside is that this drags you into either mixed-language
development, compiler-dependant assembler escapes, or both.  Forcing
people to use one compiler on platforms where other decent compilers
are available doesn't always work out well.  (Among other things,
there are Unix platforms where there's an extra-cost vendor compiler
which isn't necessarily as widely deployed as gcc, but generates
noticably better code).   Of course, these considerations don't
necessarily apply to the embedded code for a PBX, but in
cross-platform development, the simpler you can keep your build
environments, and the less you constrain them, the better.

(I only resorted to assembler on one platform --- AIX --- and then
only for something (longjmp error trapping) which I couldn't figure
out how to accomplish in anything resembling C). 

Hopefully, this isn't too far off topic; I'm posting mainly because
this may be of interest to people who are considering new kaffe ports.

rst


More information about the kaffe mailing list