Linked by Hadrien Grasland on Fri 27th May 2011 11:34 UTC
General Development After having an interesting discussion with Brendan on the topic of deadlocks in threaded and asynchronous event handling systems (see the comments on this blog post), I just had something to ask to the developers on OSnews: could you live without blocking API calls? Could you work with APIs where lengthy tasks like writing to a file, sending a signal, doing network I/O, etc is done in a nonblocking fashion, with only callbacks as a mechanism to return results and notify your software when an operation is done?
Permalink for comment 474953
To read all comments associated with this story, please click here.
RE: Comment by voidlogic
by Alfman on Sun 29th May 2011 18:54 UTC in reply to "Comment by voidlogic"
Member since:


"All of this non-blocking IO being mentioned is great in theory; however, I have see countless cases of software re-written be be non-blocking and being slower."

I've seen it go both ways, so I think some detective work is warranted.

"A high profile example is the NIO connector for Apache Tomcat 6....In every production environment I have ever benchmarked JIO is found to be fastest."

I can accept that this is true.

"The Tomcat programmers are clearly experienced developers who know what they are doing, yet they failed to make their more complicated non-blocking connector faster... "

As far as I know, tomcat is still MT and isn't using an async model. They merely converted a blocking threaded version to a non-blocking threaded version, and the results got worse. My guess is that dynamically create threads in the NIO version, which is more expensive than blocking existing threads.

This is just pure speculation on my part, but it could explain why they didn't get any speedup.

"Most aync implementations imply more syscalls-"

Could you elaborate? I don't think it's true. In fact the opposite is sometimes true using epoll/libaio interfaces since we can handle several sockets asynchronously in a single syscall.

Linux support for AIO is still immature though.

"My thought, if reimplementing software to use async io, benchmark it! Just becuase your model/algorithm is faster in theory does not mean anything."


Reply Parent Score: 2