Sounds like it should be possible, but first a couple
questions.
You didn't define key. Key to what?
By key I mean java.nio.channels.SelectionKey. It would be beyond the scope of this discussion to elaborate on this. For some more resources, see the following links:
http://www.onjava.com/pub/a/onjava/2002/09/04/nio.html
http://www.owlmountain.com/tutorials/NonBlockingIo.htm
Why a thread pool? I'd start with a ThreadGroup and
then just "new" Threads in that group as needed.
Thread.start() really means "create this Thread, call
its run() method, let it run, discard the Thread when
run() is finished. Usually this let's Java do all the
work you'd think you have to do for yourself.
The main advantage of a thread pool is that it saves
you the creation time of threads in the middle of a
running program. Thread creation is quite expensive and
a thread pool creates threads on startup of my server.
These threads are then waiting for something to do.
Creating a thread each time some work comes in is generally
not a good idea if you can avoid it.
See http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/perf.html#pool
for an excellent example of a thread pool implementation.
Anyhow, I came here looking for advice on java.nio,
which you might have: any experience with direct
mapped buffers? Will these get me from disk to RAM w/o
passing through the CPU (Wintel boxes)? (I'm working
on high-speed, enhanced b-trees - heavy into keys but,
I suspect, not the same keys you're talking about.)
Do you mean the class MappedByteBuffer here, which maps a
file directly to a ByteBuffer or do you mean a ByteBuffer
as returned by ByteBuffer.allocateDirect(int)? The first
provides a direct mapping from a physical file to a
ByteBuffer, the second provides you with a ByteBuffer that
is directly mapped to native memory (outside the JVM heap).