In an effort to reduce number of threads used in JXTA-C, we wanted to use a thread pool that can have a hard limit. With that and consolidating threads created to process different task queues into a single queue resides in thread pool, it is more efficient. Same amount of tasks can be served with less threads.

As JXTA-C use Apache Portable Runtime for portable layer, it is natural fit to contribute the work back to the project. After lengthy wait, due to the legal issue as well as waiting APR developers have cycle to help commit it, finally the initial commit was made. I have to thank wrowe for helping the process all the way.

Current implementation is very simple and straight-forward, and you can even use the thread pool as a timer or scheduler whatever you like to call it. You can review the API. Basically each task is given a priority or a wait period, and the low priority ones can be starving, nevertheless it is useful enough for general cases. Hopefully it can get evolved to support different queue process policies. For now, a small bug fix and improvement can be found at bug #41359.
 

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by slowhog