• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread pool

 
Mike Nightsky
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anybody experience with Threadpools or a good example of an working one?
Thanks in advance.
Mike
 
Alex Zhang
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have implemented thread pool twice in two project. Do U mean U want to have coding sample?
My implementation is that once the pool is instantiated, it will itself create a cluster of threads which are available for assigning.
Threads will be assigned to the requesters in an ordered manner which can be replaced with any mechanism, some may like round robbin. here I just use it as a reference.
If the number of available threads reaches 0, I will increase the pool size by adding additional threads to it.
If U want to have detail implementation, please reply and let me send U the code.
 
John Harby
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Doug Lea has an excellent implementation in his (open source) package -
http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic