简体   繁体   English

在实践中发生虚假唤醒

[英]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 ie threads which exited their wait() method without being notified and before the wait timeout has expired. 在运行Java 1.7.0_09的双四核Windows 2008 64位服务器上进行3000次并发会话和每秒约300次事务的负载测试期间,我们在实践中观察到两个已确认的虚假唤醒实例,即线程退出其wait()方法而未通知在等待超时到期之前。

During the time of the wakeup the machine CPU was at less than 20% and plenty of memory was available. 在唤醒期间,机器CPU不到20%并且有足够的内存可用。 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. 虚假的唤醒现象记录在java.lang.Object的JavaDoc中等待,但它是我第一次在实践中看到它。 Is this a bug in Windows or in Java ? 这是Windows或Java中的错误吗?

由于它是文档记录,它不能是一个错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM