So I have a thread (thRemote) that spawns several other threads (thTcpListener) to perform a certain task.
I am currently trying to create a mechanism that will allow my (thRemote) thread to "wait" for all (thTcpListener) threads to finish phase I (and subsequently somehow notify thRemote) before it continues... (thRemote should not move forward until the threads have completed the first couple of operations such as connecting, etc...)
So, in essense, I want to "pause" or "sleep" the thread (thRemote) until which time the last (thTcpListener) thread has reported back (somehow, still working on this) that it has completed phase I...
I imagine I could always use a WHILE LOOP and just loop until which time my bool becomes false (which would occur when all thTcpListeners reported back complete phase I) but that just sounds like bad programming - so I thought of maybe using Sleep()? or Suspend()? But sadly I have absolutly no experience with either and therefore I wanted to seek some guidance...
Any ideas, hints, and help would be greatly appreciated, thanks
I am currently trying to create a mechanism that will allow my (thRemote) thread to "wait" for all (thTcpListener) threads to finish phase I (and subsequently somehow notify thRemote) before it continues... (thRemote should not move forward until the threads have completed the first couple of operations such as connecting, etc...)
So, in essense, I want to "pause" or "sleep" the thread (thRemote) until which time the last (thTcpListener) thread has reported back (somehow, still working on this) that it has completed phase I...
I imagine I could always use a WHILE LOOP and just loop until which time my bool becomes false (which would occur when all thTcpListeners reported back complete phase I) but that just sounds like bad programming - so I thought of maybe using Sleep()? or Suspend()? But sadly I have absolutly no experience with either and therefore I wanted to seek some guidance...
Any ideas, hints, and help would be greatly appreciated, thanks