Q: what happens between socket receiving the msg and the invocation of onMsg()?
Q: is the listener thread blocked in read() or wait()
%%A: wait() I guess.
Q: if wait(), then which threads notify it?
%%A: perhaps a single socket reader thread is responsible to notify multiple listener threads that are interested in the same data. For max performance, listener threads might run on separate processors. They may be waiting in different monitors. I think the socket thread may either notifyAll or sequentially notify each listener thread.