Title: TRtcQuickJob Post by: HelgeLange on May 12, 2015, 11:23:22 PM Not sure how to implement it, but I'm trying to implement a quickjob list, where every quickjob is managing exactly 1 database as serialized job. I can't use your thread pool (although would love to), because I need several thread running but it has to be serialized for every unique database.
So far so good, I don't thinks that's problematic at all. But when I have to shut down the service and some jobs are running, I might have to wait until they finish what they're doing. I saw in your code, that you send a simple message to tell the thread to stop, which will be received asynchron when the current job is finished. A construct like I'd normally do Code: While FpJobList.Count > 0 Do begin Is there a possibility that you insert an event when the thread is stopped and I can remove it from the list and free the object ? It would allow to write some bigger loop where i can wait for every single job to stop. Thanks in advance, Helge Title: Re: TRtcQuickJob Post by: D.Tkalcec (RTC) on May 12, 2015, 11:29:14 PM TRtcQuickJob components do NOT create nor do they stop threads. They use the RTC Thread Pool. The main reason for the existence of the TRtcQuickJob component, is to allow simple execution of quick jobs in the background, without having to manually create and destroy threads.
Best Regards, Danijel Tkalcec Title: Re: TRtcQuickJob Post by: HelgeLange on May 13, 2015, 12:41:08 AM Ah, I understand now... I can destroy the component without problems, the job will continue running until it's done anyway and the the pool will destroy it because of the quit message...
|