aspose file tools*
The moose likes Threads and Synchronization and the fly likes Thrad Pooling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Thrad Pooling" Watch "Thrad Pooling" New topic
Author

Thrad Pooling

kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1376
My thread pool will hadle 1 Lakh concurrent requests, if if receive 2 Lakhs concurrent request at the particulat point of time, how can i handle?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I had to ask somebody down the hall who said 1 lakh == .1 million

Thread pools (and other resource pools) often work with a queue. You put commands into the queue and some number of threads pull commands out of the queue and execute them. If you put commands in faster than the threads can handle them, the commands pile up in the queue and wait.

There are many things you can tune ... Set a max size on the queue, when it's full throw an exception or wait or send a busy reply. Set max & min numbers of threads, start new ones up to the max, stop idle ones down to the min. Set max wait time for queue items and throw exceptions if they're in there too long.

The JDK 5 BlockingQueue and Executors support a lot of options. What thread pool are you using?
[ February 24, 2005: Message edited by: Stan James ]

A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
kri shan
Ranch Hand

Joined: Apr 08, 2004
Posts: 1376
I am not using any Appserver's /third party thread pool. It's my own.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Ah, then it's entirely up to you what happens! Are you using a blocking queue design? It wouldn't hurt to read the JDK 5 and other open source pool docs for some ideas.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Thrad Pooling