EDN Admin
Well-known member
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
<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