digitalmars.D - Threading in D?
- mclysenk (4/4) Dec 03 2004 What sort of synchronization mechanisms does D provide for multiple thre...
- Ben Hinkle (10/17) Dec 04 2004 The D language has basic critical section support using the "synchronize...
- Sean Kelly (6/24) Dec 04 2004 Note that "synchronized" just indicates that the compiler should not opt...
- Ben Hinkle (1/8) Dec 04 2004
- Sean Kelly (4/7) Dec 05 2004 Oops. Yes I did. That's what I get for posting before having my mornin...
What sort of synchronization mechanisms does D provide for multiple threads? Is there any standard implementation of structures like locks / memory barriers? Java has the methods wait() and notify() built in each object, and C/C++ has many libraries which can get the job done. What is there in D/Phobos?
Dec 03 2004
"mclysenk" <mclysenk_member pathlink.com> wrote in message news:cordtd$fbo$1 digitaldaemon.com...What sort of synchronization mechanisms does D provide for multiple threads? Is there any standard implementation of structures like locks / memory barriers? Java has the methods wait() and notify() built in each object, and C/C++ has many libraries which can get the job done. What is there in D/Phobos?The D language has basic critical section support using the "synchronized" statement or attribute. It doesn't have wait/notify or other types of locks. The "volatile" statement is for memory barriers. A port of the Java 1.5 concurrency classes is available at http://home.comcast.net/~benhinkle/mintl/locks.html It has a reentrant lock with condition variables, countdown, cyclic-barrier, exchanger, semaphore and a read-write lock. -Ben
Dec 04 2004
In article <cot4e8$2s7u$1 digitaldaemon.com>, Ben Hinkle says..."mclysenk" <mclysenk_member pathlink.com> wrote in message news:cordtd$fbo$1 digitaldaemon.com...Note that "synchronized" just indicates that the compiler should not optimize past those barriers. AFAIK there are currently no hardware-level barrier instructions in place, so lockless synchronization methods make a handy supplement. SeanWhat sort of synchronization mechanisms does D provide for multiple threads? Is there any standard implementation of structures like locks / memory barriers? Java has the methods wait() and notify() built in each object, and C/C++ has many libraries which can get the job done. What is there in D/Phobos?The D language has basic critical section support using the "synchronized" statement or attribute. It doesn't have wait/notify or other types of locks. The "volatile" statement is for memory barriers. A port of the Java 1.5 concurrency classes is available at http://home.comcast.net/~benhinkle/mintl/locks.html It has a reentrant lock with condition variables, countdown, cyclic-barrier, exchanger, semaphore and a read-write lock.
Dec 04 2004
Note that "synchronized" just indicates that the compiler should not optimizeI think you meant "volatile" instead of "synchronized", yes?past those barriers. AFAIK there are currently no hardware-level barrier instructions in place, so lockless synchronization methods make a handy supplement. Sean
Dec 04 2004
In article <cotr0v$m1l$1 digitaldaemon.com>, Ben Hinkle says...Oops. Yes I did. That's what I get for posting before having my morning coffee. SeanNote that "synchronized" just indicates that the compiler should not optimizeI think you meant "volatile" instead of "synchronized", yes?
Dec 05 2004