BTW, given recent discussion on memory barriers, I think my previous statement that the mutex does not need to be locked to call notify is probably incorrect.

Haven't had any issues calling notify outside a synchronized statement, even from multiple threads. At least this works under Win32 with my producer thread all wrapped inside synchronized(). Only a single consumer thread is inside synchronized() but then i have 2 more threads making naked calls to notify(). Not a single crash.

Reply via email to