Tobias Pfaff Wrote: > On 11/11/2010 03:24 AM, jfd wrote: > > Any thoughts on parallel programming. I was looking at something about > > Chapel > > and X10 languages etc. for parallelism, and it looks interesting. I know > > that > > it is still an area of active research, and it is not yet (far from?) done, > > but anyone have thoughts on this as future direction? Thank you. > > Unfortunately I only know about the standard stuff, OpenMP/OpenCL... > Speaking of which: Are there any attempts to support lightweight > multithreading in D, that is, something like OpenMP ?
I've considered backing spawn() calls by fibers multiplexed by a thread pool (receive() calls would cause the fiber to yield) instead of having each call generate a new kernel thread. The only issue is that TLS (ie. non-shared static storage) is thread-local, not fiber-local. One idea, however, is to do OSX-style manual TLS inside Fiber, so each fiber would have its own automatic local storage. Perhaps as an experiment I'll create a new derivative of Fiber that does this and see how it works.