Results 1 to 3 of 3
  1. #1
    guest_user is offline Member
    Join Date
    May 2011
    Posts
    47
    Rep Power
    0

    Default How do I go about implementing a self tuning thread pool?

    I've implemented a thread pool that has only a fixed number of threads running, how would I go about dynamically tuning this number based on the load of the server?

    Prefer to go about implementing it rather than using the one in the java libraries for the learning process.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default

    Define 'tuning'....if there are many requests, you should have a queue to handle those requests in turn. If there is a lack of requests, your should have threads waiting for requests. If by tune you mean make more efficient, there should be a clear demonstration that your present code will present a problem in a particular scenario to make the refactoring worth the effort.

  3. #3
    guest_user is offline Member
    Join Date
    May 2011
    Posts
    47
    Rep Power
    0

    Default

    Quote Originally Posted by doWhile View Post
    Define 'tuning'....if there are many requests, you should have a queue to handle those requests in turn. If there is a lack of requests, your should have threads waiting for requests. If by tune you mean make more efficient, there should be a clear demonstration that your present code will present a problem in a particular scenario to make the refactoring worth the effort.
    What I meant was when there is high load, the number of worker threads in the pool would increase and when the load returns to normal the worker threads are deleted accordingly

Similar Threads

  1. need help with thread pool
    By crank6015 in forum New To Java
    Replies: 1
    Last Post: 04-03-2011, 02:47 PM
  2. Replies: 0
    Last Post: 02-11-2011, 03:21 PM
  3. How to correctly use a fixed size thread pool?
    By johann_p in forum Threads and Synchronization
    Replies: 1
    Last Post: 09-19-2010, 02:04 AM
  4. Thread Count Extends Beyond Pool
    By jvermast in forum Threads and Synchronization
    Replies: 1
    Last Post: 04-01-2010, 07:47 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •