David Schwartz 428 Posted January 27, 2022 I have this code: join := Parallel.Join .NumTasks( NumThreads_spinner.Value ) .OnStopInvoke( // called after EACH task completes procedure begin doSomething; end ) .TaskConfig( Parallel.TaskConfig.OnTerminated( // called when ALL tasks have completed procedure (const task: IOmniTaskControl) begin doSomethingElse; end ) ); The OnStopInvoke method only takes a TProc parameter. However, Parallel.TaskConfig.OnTerminated takes both a TProc and a procedure (const task: IOmniTaskControl). This seems sort of backwards, because the first one operates on a single task, while the second one is the entire list of tasks. (What task is being passed to OnTerminated? The last one what finished up?) Anyway, my question is ... how can I get the OnStopInvoke proc to know which task just finished? Share this post Link to post