I¹m trying to implement a simple thread pool model (Java 1.4) for a telemetry application.
I¹m getting up to speed with threads but I haven¹t been able to find any examples of setting a thread pool in a server/servlet environment. I have a number of remote units which upload telemetry data for processing via http and receive instructions via the response. The instructions aren¹t dependent on the results of data processing. At present I fire off a new thread to process the data for each unit, but it makes sense the best approach would be to have a fixed pool of threads and then add the data to a queue which is processed by the pool of threads. It¹s setting up the initial pool that I¹m a little unclear about. Do I setup a Threadpool servlet and set it to load on startup and store the pool in the application scope? Any advice or pointers to some good information would be appreciated. Z.