[LLVMdev] Stack swapping

Florian Weimer fw at deneb.enyo.de
Sat Jun 20 02:15:08 PDT 2009


* Wesley W. Terpstra:

> I have a number of ideas on how to get this to work, but also assume
> that MLton isn't the first project which swaps stacks. What's the
> established best practice for managing multiple stacks under LLVM?

I think this isn't really a LLVM question.  For most platform ABIs,
LLVM code is compatible with stack switching because historically,
this was how multi-threading was implemented (and pthreads looks a lot
like stack switching, too), and there is quite a bit of software
around which does it (the PowerDNS recursor, Lua with the Coco patches
and LuaJIT).

The Coco patches for Lua have some discussion about portability and
implementation choices: <http://luajit.org/coco.html>



More information about the llvm-dev mailing list