SelectableChannel.register() & thread safety question

A

Axel Bock

Hi,

my question is about the thread safety of the
SelectableChannel.register() method. In my first thread I would like
to register channels (serverChannels) to a Selector instance, while a
second thread actually calls selector.select().

Now the thing is - does anybody know if that could actually work, or
is that a bad idea?


Greetings & thanks for your efforts already,
Axel.
 
D

Daniel Pitts

Hi,

my question is about the thread safety of the
SelectableChannel.register() method. In my first thread I would like
to register channels (serverChannels) to a Selector instance, while a
second thread actually calls selector.select().

Now the thing is - does anybody know if that could actually work, or
is that a bad idea?

Greetings & thanks for your efforts already,
Axel.

According to <http://java.sun.com/j2se/1.5.0/docs/api/java/nio/
channels/SelectableChannel.html>
"Selectable channels are safe for use by multiple concurrent threads."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top