Multithreading
i am using 5 threads...5 tasks....now every thread dies after doing task it in run()...i want that it wont die but start doing 6th task ...means if i have 10 taska then same 5 thread i can use for rest 5...
basically what i want is thread pooling
can any one help me on that ?
[302 byte] By [
anpad] at [2007-9-26 9:23:39]

You could make a ThreadPool class which keeps a semaphore for the group of threads, and ensures that any more than the Nth request get paused until another thread is finished.
You would have to do some stitchwork though, as Thread itself can't change its Runnable instance in mid-stream. Although, you could easily make a sub-class of Thread which can.