B4J Question Best architecture to implement a finite scheduling program?


Well-Known Member
Licensed User
Longtime User
Looking for advice so I don't get off to any false starts here. It is my intention to write a finite scheduling program.
I know how to do what I want to do but it will involve millions of calculations so what I need advice on is the architecture to make this run fast.
As a gross oversimplification Think:
10 to 5000 jobs
Each Job has 5 to 150 operations that must be performed sequentially. The time needed for each Op is known.
5 to 100 machines. Some interchangeable some not. One job at a time on a machine (well, not on Cells but that's another issue).
Each Job has a due date.
Schedule all ops such that each job is done by the due date.
This will all be done on one computer.

So my thinking is a Standard Class Module which can be instantiated multiple times, each time with its own parameters and each running in a separate thread?
Each Module returns a "Score" which is compared to previous iterations - may the best Score win.
If the solution is a better score then the solution is stored in the main thread.
Is this a good solution?

How, exactly do I implement it without starting too many threads at once. Count processors?
Would it be substantially faster to implement the calculator as a non-ui server?
I have read a bunch of the posts here about threading, and frankly, it is over my head. I could spend a week writing some experiments but I am hoping someone can tell me "Just do it this way":)
Thanks in advance for any and all ideas.

William Lancee

Well-Known Member
Licensed User
Longtime User
I think that your planned approach using instances of classes is appropriate. I researched this a bit.
I found this article informative.


I am very interested in how you end up doing it in this huge project.
I don't think UI or non-UI will make a difference.
May be someone else will comment on threading issues. I have not exceeded any threading limits (if there are any).
Upvote 0