At work I needed to create a fixed Java work pool. By “fixed”, I mean a pool that has no queue: it has a maximum number of workers, and it should not store work if it has no capacity to immediately process. Introducing the Players To accomplish this, I used the following classes: ThreadPoolExecutor – Executes work jobs LinkedBlockingQueue – Passes jobs to the thread pool ExecutorCompletionService – Gets results back from thread pool executions, and provides synchronization Instantiation I created the main thread pool using the following code:
At work, am known as someone who gets things done. Even when problems seem insurmountable, I eagerly tackle them and come up with novel out-of-the-box solutions. However, recently, I was in charge of delivering a portion of the product, and it did not go well. I had to get things done by mid-April. However, it wasn’t until early May that the work was complete. Unfortunately, for a significant portion of this time, I was blocked by an external contractor.