Waiting on Threads

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
In my latest program, Fibonacci, I am working on module 5 which uses threads. The problem I see is how to wait for them to finish.


<pre lang=x-cpp>void fib5() {
// Lets now create our second thread and ask it to start
_beginthread( fib4, 0, NULL );
// From here on there are two separate threads executing our one program.

// This main thread can call the threaded function if it wants to.
//fib4(NULL);
Sleep(100); // Wait for the thread to terminate
}

[/code]
<br/>

<hr class="sig Vote if answered or helpful, I am running for Office (joke)!
http://contract-developer.dyndns.biz IT/Developer, Windows/Linux/Mainframe RaidMax Smilodon, 680W, Asus M2NBP-VM CSM, AMD X2 4200+, 2GB DDR2-800, HD2400 Pro, more details on my site, need a new boot disk, existing one is 5 years old

View the full article
 
Back
Top