Filip Hanik - Dev Lists wrote:
just a small observation,
working with multiple polling threads is pretty hard, we do it in the
clustering code (NIO), on the receiver side of things,
and it took a while to work out the kinks, and you need a shared place
to lock, since a lot of the operations are not thread safe.
The code becomes somewhat complex.
I haven't made myself familiar enough of the APR code to comment there,
but I can imagine the same scenario would be there. Usually a single
thread, even on a multi CPU machine can perform all polling, as long as
it doesn't do anything but read the buffer, then pass it on to a thread.
If the poller thread starts doing more, such as putting packages
together, copy data, deserialization etc, then you'll find yourself in a
bottleneck.
I like this guys approach,
http://www.onjava.com/pub/a/onjava/2004/09/01/nio.html?page=1
he had the same experience, one poller thread becomes way more
manageable code, and he created a neat design of putting back
registration request to happen async or sync.
It seems fine in our case.
Rémy
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]