[RFC] "lock" statement and "mutex" type.
Graham St Jack
grahams at acres.com.au
Tue Mar 14 17:06:44 PST 2006
Dejan Lekic wrote:
> BCS, on contrary - it is not considered - that is why I began this
> thread... :) So far all participants in this discussion agrees that D
> (language) needs this what we discuss. Sure everything depends on Mr.
> Bright.
>
> -----------
> Dejan Lekic
> http://dejan.lekic.org
>
I agree that better threading support is needed in D. The synchronized
keyword is a great start, but more is needed.
My opinion is that try_lock() on a mutex isn't a good idea - it is
better to use conditions. You use mutexes to keep threads "apart" from
each other (the synchronized keyword does this very well), making sure
that no thread retains a lock for long.
You use conditions to enable a thread to "block" for potentially
extended periods, without any thread retaining a lock on the mutex.
A couple of other related posts are:
http://www.digitalmars.com/d/archives/digitalmars/D/31340.html
http://www.digitalmars.com/d/archives/digitalmars/D/34392.html
More information about the Digitalmars-d
mailing list