Re: Condition Mutexes

2009-10-21 Thread Bartosz Milewski
dsimcha Wrote: void main() { condition = new Condition( new Mutex() ); auto T = new Thread(waitThenPrint); T.start(); condition.notify(); // Never wakes up and prints FOO. } Your program terminates immediately after sending the notification. You need to stall the exit

Re: Condition Mutexes

2009-10-21 Thread dsimcha
== Quote from Bartosz Milewski (bartosz-nos...@relisoft.com)'s article dsimcha Wrote: void main() { condition = new Condition( new Mutex() ); auto T = new Thread(waitThenPrint); T.start(); condition.notify(); // Never wakes up and prints FOO. } Your program

Re: Condition Mutexes

2009-10-21 Thread Jason House
dsimcha Wrote: == Quote from Bartosz Milewski (bartosz-nos...@relisoft.com)'s article dsimcha Wrote: void main() { condition = new Condition( new Mutex() ); auto T = new Thread(waitThenPrint); T.start(); condition.notify(); // Never wakes up and prints FOO. }

Re: Condition Mutexes

2009-10-21 Thread dsimcha
== Quote from Jason House (jason.james.ho...@gmail.com)'s article dsimcha Wrote: == Quote from Bartosz Milewski (bartosz-nos...@relisoft.com)'s article dsimcha Wrote: void main() { condition = new Condition( new Mutex() ); auto T = new Thread(waitThenPrint);

Re: Condition Mutexes

2009-10-21 Thread Jérôme M. Berger
dsimcha wrote: == Quote from Bartosz Milewski (bartosz-nos...@relisoft.com)'s article dsimcha Wrote: void main() { condition = new Condition( new Mutex() ); auto T = new Thread(waitThenPrint); T.start(); condition.notify(); // Never wakes up and prints FOO. } Your program

Re: Condition Mutexes

2009-10-21 Thread Steven Schveighoffer
On Wed, 21 Oct 2009 14:50:32 -0400, dsimcha dsim...@yahoo.com wrote: == Quote from Bartosz Milewski (bartosz-nos...@relisoft.com)'s article dsimcha Wrote: void main() { condition = new Condition( new Mutex() ); auto T = new Thread(waitThenPrint); T.start();

Re: Condition Mutexes

2009-10-21 Thread dsimcha
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article On Wed, 21 Oct 2009 14:50:32 -0400, dsimcha dsim...@yahoo.com wrote: == Quote from Bartosz Milewski (bartosz-nos...@relisoft.com)'s article dsimcha Wrote: void main() { condition = new Condition( new Mutex() );

Re: Condition Mutexes

2009-10-21 Thread Bartosz Milewski
dsimcha Wrote: Bartosz, since you're a threading guru, could you please write a simple test program using core.sync.condition and see if it works, and if not either file a bug report or let me know? Conditions were implemented by Sean Kelly, so he's the guru. The file condition.d in

Re: Condition Mutexes

2009-10-21 Thread dsimcha
== Quote from Bartosz Milewski (bartosz-nos...@relisoft.com)'s article dsimcha Wrote: Bartosz, since you're a threading guru, could you please write a simple test program using core.sync.condition and see if it works, and if not either file a bug report or let me know? Conditions were

Re: Condition Mutexes

2009-10-21 Thread Steven Schveighoffer
On Wed, 21 Oct 2009 17:13:48 -0400, Bartosz Milewski bartosz-nos...@relisoft.com wrote: dsimcha Wrote: Bartosz, since you're a threading guru, could you please write a simple test program using core.sync.condition and see if it works, and if not either file a bug report or let me know?

Condition Mutexes

2009-10-20 Thread dsimcha
I'm messing around w/ core.sync. Does anyone know what I'm doing wrong in this program? It just hangs. If I could figure out ()##$) condition mutexes (right now, I'm using busy spinning), I might have a decent implementation of parallelForeach over ranges. import core.sync.mutex

Re: Condition Mutexes

2009-10-20 Thread Graham St Jack
On Wed, 21 Oct 2009 00:56:13 +, dsimcha wrote: I'm messing around w/ core.sync. Does anyone know what I'm doing wrong in this program? It just hangs. If I could figure out ()##$) condition mutexes (right now, I'm using busy spinning), I might have a decent implementation