How expensive is synchronization?

Posted by someguy on Stack Overflow See other posts from Stack Overflow or by someguy
Published on 2010-04-15T16:14:55Z Indexed on 2010/04/15 16:23 UTC
Read the original article Hit count: 123

Filed under:
|
|

I am writing a networking application using the java.nio api. My plan is to perform I/O on one thread, and handle events on another. To do this though, I need to synchronize reading/writing so that a race condition is never met.

Bearing in mind that I need to handle thousands of connections concurrently, is synchronization worth it, or should I use a single thread for I/O and event handling?

© Stack Overflow or respective owner

Related posts about java

Related posts about nio