Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: Win7VC++
Hi There,
I have created for 10 threads using AfxbeginThread API.
but i wants to start all 10 threads at a time, i don't wants to start the thread one by one.
Can any one can help how to implement.

Posted 22-Jan-13 1:31am
Sergey Alexandrovich Kryukov at 22-Jan-13 11:18am
This is not a question, and you statement simply makes no sense. If you think about it, you will see that there is no difference. —SA

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

It is very easy to do. In the main program body (main thread) create an Event Object[^] with the initial state nonsignaled. Pass the event handle to all your threads. Then in all the thread routines specify WaitForSingleObject() to wait for the event to become signaled. Once you have created all the threads, put the event to signaled state using SetEvent(). All your threads will continue execution.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
0 Shai Vashdi 1,588
1 OriginalGriff 528
2 Manas Bhardwaj 383
3 Damith Weerasinghe 330
4 Tadit Dash 315
0 Sergey Alexandrovich Kryukov 9,575
1 OriginalGriff 6,006
2 Peter Leow 4,500
3 Maciej Los 3,540
4 Abhinav S 3,513

Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 22 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Use
Layout: fixed | fluid