[M3devel] a note on user thread -- *context not 'universal'

Jay jay.krell at cornell.edu
Mon Jan 12 23:20:24 CET 2009


They really don't seem to be there, on 10.4.
I haven't check the libs yet but they are not in the headers or man pages.
Do you have installed the "multiple SDKs" (headers/libs for multiple OS versions)?
Look at in /Developer/SDKs.
Anyway, they also aren't on OpenBSD so a dual approach will be needed
which I think is ok.
Heck, probably one set of Modula-3 but #ifdefed C.
 
 - Jay



From: hosking at cs.purdue.eduTo: jay.krell at cornell.eduDate: Tue, 13 Jan 2009 08:01:33 +1100CC: m3devel at elegosoft.comSubject: Re: [M3devel] a note on user thread -- *context not 'universal'


They *are* available on Darwin 10.5 and I am pretty sure they were there on 10.4.  Have you installed the developer kit (with man pages)?

On 13 Jan 2009, at 01:05, Jay wrote:

just a note, that make/get/set/swapcontext are not available on Darwin (10.4) and OpenBSD.I didn't check NetBSD. It is on Linux, Solaris, FreeBSD. A "dual" approach where some ports use setjmp/longjmp, some use *context, probably reasonable. Another approach that would probably work is you double up the jmpbuf.Always make a copy before setjmp and setjmp to the copy.That way if longjmp "scrambles" it, no matter.If you can't even copy them, well, setjmp to the "original", copy it away, and thenrecopy before any setjmp. However, this is inefficient and using *context is probably better, where it is available. question: On Windows, you can "reserve" virtual memory, and "commit" it."reserve" is allocating just the address space."commit" I think is ensuring there is room in a pagefile.Reserve is cheaper. You can overrreserve but I guess not long-term overcommit.Usually stacks are only ever at first reserved, and then commited gradually,like a page at a time. Whatever *context documentation I could find, didn't talk about this.They either used a local char array, or a called mmap.On at least some platforms, there a flag to mmap to indicate you are creating a stack.  Do we really need the assembly _fpsetjmp? - Jay
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20090112/47ceeb86/attachment-0002.html>


More information about the M3devel mailing list