lyaffe
lyaffe

Reputation: 1447

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 ?

Upvotes: 5

Views: 511

Answers (1)

Alexei Kaigorodov
Alexei Kaigorodov

Reputation: 13535

Since it is documented, it cannot be a bug.

Upvotes: 3

Related Questions