• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The evil Selector bug - workarounds?

 
Ranch Hand
Posts: 1365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic