[M3devel] friendly reminder/request for cooperative suspend

Jay K jay.krell at cornell.edu
Sun Sep 16 23:31:12 CEST 2012


I'm targeting ANSI C. Maybe with a K&R option. (K&R has been useful surprisingly recently -- the bundled HPUX/HPPA compiler is K&R, it is there just to recompile "data" and relink the kernel; and on my Irix install I happened upon a bundled compiler that I recall might have been K&R).


And then later an option for C++, specifically for exception handling.
And an option to use __try/__except/__finally on NT, and maybe similar in other systems if I can test them (VMS, Tru64, Ultrix, but really, setjmp for non-mainstream platforms is fine, esp. given a C++ option).
And maybe C++ to optimize static chain handling.


Hopefully nothing else will be particularly compiler specific.


But for now I'm just testing with whatever is in my Mac.


 - Jay


Subject: Re: [M3devel] friendly reminder/request for cooperative suspend
From: dragisha at m3w.org
Date: Sun, 16 Sep 2012 11:00:51 +0200
CC: jay.krell at cornell.edu; m3devel at elegosoft.com
To: hosking at cs.purdue.edu

Can we have clang as a reference compiler, one we target with our C++ backend?

--Divided by a common language
Dragiša Durićdragisha at m3w.org



On Sep 14, 2012, at 5:10 PM, Antony Hosking wrote:Yes, this is on the top of my list of things to do.Plus fix some atomics bugs.atomics plus cooperative suspend gives us a much better story on locks too.We could even have a proper memory model like C++11.
LLVM would also be great (better even than the C backend) because we'd get some decent optimization passes.


On Sep 14, 2012, at 4:01 AM, Jay K <jay.krell at cornell.edu> wrote:friendly reminder/request: I'd like to see the system changed to use cooperative suspend.

Combined with a C backend, that would greatly expand portability and remove existing target-dependent code (i.e. already ported) from the system.

I'm not confident that GetThreadContext works on "wow64".It'd fix that.

We can compute the top/bottom of the stack fairly portably -- address of locals.We can capture current context/registers via setjmp.Or maybe getcontext.(We should find out about setjmp/longjmp munging -- what gets munged? Everything? Just non-gc-roots? Only after longjmp?)Itanium is special -- there is a second stack growing up from the same base.

I'd like this way more than LLVM.

Maybe I can work on. Maybe.

I believe typical production Java VMs use cooperative suspend.

 - Jay

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20120916/ed5bde66/attachment-0002.html>


More information about the M3devel mailing list