I am learning mulithreading in delphi and I would like to know if some of you
could post me some basical example (not how use threads) on how using mutex, Tevent, and semaphore in order to syncronize code in thread Excute method and thread's events and how check the signaled state with WaitForSingleObject?
Is it reasonable to use semaphore for limiting the number of running threads?
For exmaple if I want to limit the max running threads may i use this?
CreateSemaphore (nil, 20,20,'MyS');
And what happen if one thread get timeout or can't access to resource? It's lost or it will be put in Wait state ?