Then I guess I either didn't understand the role of the queue, or the name is a bit misleading:
At first I was thinking the OTL queue is basically some kind of a TStringList (or a fast hash list) containing the list of the future tasks put in queue (once a task is completed, OTL gets the next entry in queue/list, run it as a task and then delete it from queue).
I have a backup application, when a user specify a folder to backup, I have to scan it, find the files that I need to backup, then back these files in batch of 20 (for example).
My users can specify a folder containing 25,000 files to backup (or even an entire disk!), the way I do it right now is by using a waiting list:
- I create 20 threads, each one backing up a file
- For other files, I save them in an ACID db (in case the app crashes) and then put them in a special WaitingList
- When a thread is done, I get the next entry from the WaitingList and run it as a new thread
- I repeat until there are no more files to backup
So I beg to differ: there
are situations where I have a large waiting list. There can be no more than 20 tasks at a time, and if the issue is with messages/task comm, my understanding is that the OTL built-in communication shouldn't affect neither future nor past/completed tasks.
Admittedly I just started using OTL, so I'm pretty sure I'm missing something regarding the role of the queuing system.
I was able to bypass this limitation yesterday (ie. to make my application handle such large waiting list with OTL) by making queue for the OTL queue!
It was kind of hack-ish, and kinda defeated the purpose of the OTL queuing system.
Thanks!
Khaled.