Threads don't scale, processes do - Fibers

Oliver Dathe o.dathe at gmx.de
Sat Aug 30 07:35:10 PDT 2008


> This sounds synergistic with thin-locks. Although locking code would 
> have to be moved into the thread class to allow polymorphism on how the 
> lock's aquired. i.e. Thead.getThis.lock(heavy_lock)

Polymorphism is already used for that. You could modify __monitor (or 
(cast(void*)this)[1]) in an object to show to a struct with an interface 
reference for lock() and unlock(). You can then synchronize(...) on 
that, so I don't think you have to touch Thread for that. That is what 
I've seen in tango.core.sync.Monitor.

> I'd recommend reading about JCSP (and it's C# and C++ brethren) and 
> occam / occam-pi (see: http://www.cs.kent.ac.uk/projects/ofa/kroc/ ).

Thanks, but CSP seems to have very little connection to this.



More information about the Digitalmars-d mailing list