On 8/9/2012 12:38 PM, Tom Tromey wrote: > This introduces the low-level system threading support. It also adds > the global lock. The low-level support is a bit over-eager, in that > even at the end of the present series, it will not all be used. I > think thiat is ok since I plan to use it all eventually. > > I've only implemented the pthreads-based version. I think it should > be relatively clear how to port this to other systems, though. > > I'd also like to do a "no threads" port that will turn most things > into no-ops, and have thread-creation fail. I was thinking perhaps > I'd make a future (provide 'threads) conditional on threads actually > working. Thoughts on this? If threads don't execute simultaneously anyway (and if I understand your design correctly, the global lock ensures they don't), then it might be worthwhile to also support a "green threads" implementation like GNU Pth or Windows fibers in order to avoid OS-level context switch overhead.