Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > NIO accept() loop, traditional thread for processing

Thread Tools

NIO accept() loop, traditional thread for processing

Esmond Pitt
Posts: n/a
Michael wrote:
> Well, technically they won't be simultaneous because they're in a
> single thread. You might do better to just have multiple server
> threads. Then if you have multiple CPUs you'll actually get better
> concurrency at the processing of multiple socket-accepts, and you'll
> have the benefit that the processing of each accept won't block the
> acceptance of the next.

This is a bit futile really, as accepted connections are already queued
in the kernel, and as all the accepting thread has to do is register the
accepted channel with the selector. A well-written accept loop isn't a
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
NIO multiplexing + thread pooling Giovanni Azua Java 16 09-30-2011 06:57 PM
NIO, SocketChannel and packet processing Qu0ll Java 10 11-12-2007 07:59 PM
Is the while loop of NIO suppose to be inside a Thread?: - Java 1 07-05-2005 01:59 PM
nio multi thread client performance A.R. Java 0 10-18-2004 09:34 AM
NIO with timeouts != NIO? iksrazal Java 1 06-18-2004 02:28 PM