C
ctt
Hi,
I'd like to do something similar to select() from C
where I have lots of open file descriptors (actually
sockets in my case) that I'd like to listen for read
ready condition.
From looking at Java's docs & examples, the easy way
to do this is to have a thread service each socket.
But I cannot have a thread wait on each of my socket
connections since I'm expecting 1000 (or maybe more)
sockets needing my attention.
I thought about decreasing threads' stack size to
give me more threads, but (1) that complicates my
design unnecessarily where my threads don't have too
much stack and have to ask another thread just to make
a few function calls (these functions allocates lots
of stack storage); (2) I'm working with JDK 1.3 and
can't seem to set Thread stacks individually on my
threads; (3) if there's something like the select(),
then all my problems is gone.
Thanks,
Ching Tai
I'd like to do something similar to select() from C
where I have lots of open file descriptors (actually
sockets in my case) that I'd like to listen for read
ready condition.
From looking at Java's docs & examples, the easy way
to do this is to have a thread service each socket.
But I cannot have a thread wait on each of my socket
connections since I'm expecting 1000 (or maybe more)
sockets needing my attention.
I thought about decreasing threads' stack size to
give me more threads, but (1) that complicates my
design unnecessarily where my threads don't have too
much stack and have to ask another thread just to make
a few function calls (these functions allocates lots
of stack storage); (2) I'm working with JDK 1.3 and
can't seem to set Thread stacks individually on my
threads; (3) if there's something like the select(),
then all my problems is gone.
Thanks,
Ching Tai