-
1. Re: Starting threads from Scheduler
genman Dec 13, 2005 2:50 PM (in response to kidahl)
You can easily create 5-10 schedulers programatically or just by putting them each into jboss-service.xml. If they all fire off at once, one of them executes in its own thread. -
2. Re: Starting threads from Scheduler
kidahl Dec 14, 2005 3:46 AM (in response to kidahl)Thanks for the tip!
In my case, using separate schedulers introduces the problem of coordinating them; the threads must work on different "chunks" of data to avoid conflicts.
I'm sure the coordination can be done, but it would be easier to use just one "master" scheduler if possible. -
3. Re: Starting threads from Scheduler
kidahl Dec 14, 2005 3:56 AM (in response to kidahl)Wait a minute... are you saying that a scheduler can start other schedulers programmatically? And they will all run in parallell?
I'm a bit unsure what the benefits will be over using threads, but i'll look into it.
Thanks again,
Karl Ivar -
4. Re: Starting threads from Scheduler
genman Dec 15, 2005 6:04 PM (in response to kidahl)
I'm not sure I know what you want. But if things must execute in order, it seems like you can't use separate threads, right? -
5. Re: Starting threads from Scheduler
kidahl Dec 16, 2005 3:21 AM (in response to kidahl)Almost ;)
Transactions from the same origin must be processed in sequence. Transactions from different origins can be processed i parallell.
So the threads must be coordinated to avoid working on the same origin at the same time.
Anyway, I have solved this now by using one scheduler that populates a java.util.concurrent.BlockingQueue. My worker threads feed of the blockingqueue, and the swchedulerwaits for all threads to die before finishing.
Unless starting threads from my scheduler should be avoided, I believe this is a simple solution.
-Karl Ivar