• Post Reply Bookmark Topic Watch Topic
  • New Topic

The evil Selector bug - workarounds?

 
David Weitzman
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've recently run into a problem which boggled the mind. A selector would occasionally begin to always return instantly with 0 things selected, despite no code calling wakeup to cause it. I've found a little nook in the Sun forums where people have gathered to discuss the problem. I've tried the Thread.sleep(50) workaround, but it doesn't seem to work all the time (or at least it doesn't show any signs of working after Thread.sleep(50) has been executed for 100 iterations). I even tried removing all calls to wakeup() from my code and using select(long) instead, but the problem didn't go away.

I've also tried reregistering all the keys on a new selector, but I either didn't do it properly or that doesn't help.

Does anyone know of a reliable workaround?
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David Weitzman:
I've recently run into a problem which boggled the mind....
Does anyone know of a reliable workaround?


The Sun bug parade entry 4850373 claims this is fixed in Java 1.4.2_05, that version is now available for download.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!