This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Thread pools, paced and exclusive tasks

Bai Shen
Ranch Hand
Posts: 323
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a thread pool that I've created to handle some background processing in my app. I have three kinds of tasks that I need to run.

1. Normal task. This works correctly.

2. Paced task. This task can run concurrent with others, but can only run so often. I need it to play nice and not run multiple jobs at the same time.

3. Exclusive task. Only one of these can be running at a time. If a second gets added to the queue, it needs to interrupt the first one and take over.

Is there a way to handle this without making separate thread pools for each task? Or writing a custom ExecutorService?
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic