What I am using now is a call to the method that updates the interest in writing just before the call to select. Still the event-dispatching
thread wakes up selector. Whether the selector has some IO event to notify or not, after it was awaken the next iteration calls the method mentioned above, and as a consequence select() returns immediately notifying that we can perform a writing operation.