[M3devel] darwin user threads?

Jay K jay.krell at cornell.edu
Mon Dec 14 13:52:12 CET 2009


It looks like make/get/set/swapcontext aren't viable on MacOSX 10.5.
Better on 10.6?


x86 getcontext seems to corrupt things such that a crash follows shortly.
AMD64 just doesn't work.


I happen to be experimenting again with see http://www.engelschall.com/pw/usenix/2000/pmt-html/
again to ease OpenBSD porting..and had some luck on Darwin, though had trouble getting
the timer to trigger ever or more than once.


$ cat 1.c && gcc -m32 1.c && file a.out && ./a.out ; gcc -m64 1.c && file a.out && ./a.out
#include <errno.h>
#include <stdio.h>
#include <ucontext.h>

int main()
{
 ucontext_t a;
 int b = getcontext(&a);
 printf("%d %d\n", b, errno);
 return 0;
 }
 a.out: Mach-O executable i386
0 0
Segmentation fault
a.out: Mach-O 64-bit executable x86_64
-1 45

$ grep 45 /usr/include/sys/errno.h 
#define ENOTSUP        45        /* Operation not supported */


 - Jay
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091214/1239e4d7/attachment-0001.html>


More information about the M3devel mailing list