• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Thrad Pooling

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not using any Appserver's /third party thread pool. It's my own.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic