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

Tony Hosking hosking at cs.purdue.edu
Mon Jan 12 22:01:33 CET 2009


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 then
> recopy 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/20090113/b080fd7a/attachment-0002.html>


More information about the M3devel mailing list