Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spurious wakeup occur in practice

During a loadtest with 3000 concurrent sessions and around 300 transactions per second on a Dual Quad core Windows 2008 64 bit server running Java 1.7.0_09 we observed in practice two confirmed instances of spurious wakeup i.e. threads which exited their wait() method without being notified and before the wait timeout has expired.

During the time of the wakeup the machine CPU was at less than 20% and plenty of memory was available. Also no excessive garbage collection has been observed. Luckily our recently introduced spin lock was able to trap this condition and continue the wait()

The spurious wakeup phenomena is documented in the JavaDoc of java.lang.Object wait() but its the first time I'm actually seeing it in practice. Is this a bug in Windows or in Java ?

like image 250
lyaffe Avatar asked Oct 22 '22 20:10

lyaffe


1 Answers

Since it is documented, it cannot be a bug.

like image 84
Alexei Kaigorodov Avatar answered Oct 24 '22 10:10

Alexei Kaigorodov