Jump to content


Popular Content

Showing content with the highest reputation on 08/01/21 in all areas

  1. Darian Miller

    multi-threading question

    You seem to have two main goals - do a little work after each thread completes and coordinate a bigger task once everything is done. When each thread completes you could fairly easily post a user defined windows message and have the form update the state when the message is received. For the second, more complicated synchronization issue of waiting on a varying number of threads to complete, since your total count is under 64 you could go with WaitForMultipleObjects as previously suggested. However, if your thread count might rise above that fixed limit, you may want to consider utilizing TCountDownEvent for this second task instead. Here's a blog post on it: https://www.ideasawakened.com/post/test-driving-delphi-s-tcountdownevent with corresponding example code on GitHub.