Thread Pooling (cont)
  • Better solution
    • Create a fixed set of threads
    • When a request arrives
      • Choose an idle thread
      • Have this thread execute the method
      • Return the thread to the pool
  • To make more effective use of memory
    • Vary the size of the pool based on recent load
      • High load --> more threads
    • Set upper and lower bounds on pool size

Next Slide >>