| | |
how to create Multiple threads ??? problem ???
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2009
Posts: 8
Reputation:
Solved Threads: 0
i am writing a program with threads. it's a simple program in which user will enter how many number of thread he want to be created.
what technique we use to create multiple threads ??
using for loop ???
suppose to run 3 threads...
if i use the above case how can i use my thread join statement to wait for all 3 threads???
what technique we use to create multiple threads ??
using for loop ???
suppose to run 3 threads...
c++ Syntax (Toggle Plain Text)
for(c=0; c<3; c++ ){ pthread_create(&thread[c], NULL, thread_func, NULL); }
c++ Syntax (Toggle Plain Text)
if (pthread_join(threada[0], NULL) != 0)
Wait for (join) all the threads.
C++ Syntax (Toggle Plain Text)
for (i=0;i<3;i++) pthread_join(thread[i], NULL);
Failure is not fatal, but failure to change might be. - John Wooden
![]() |
Similar Threads
- Slight Problem with arrays. (Java)
- Help multiple threads accessing buffer structure (Java)
- Multiple items with the same id problem (edit-in-place) (JavaScript / DHTML / AJAX)
- Can't Get Into My Computer, My Documents, Control Panel..etc (Viruses, Spyware and other Nasties)
- Help get me started, create multiple files from list (Shell Scripting)
- Need help with pthread's (C)
Other Threads in the C++ Forum
- Previous Thread: C++ projec need your help.
- Next Thread: Comments/Critiques Wanted on C++ OO solution to a sudoku solver
| Thread Tools | Search this Thread |
api array based binary c++ c/c++ calculator char char* class classes code coding compile console conversion count database delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory multiple news number numbertoword output parameter pointer problem program programming project python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visualstudio win32 windows winsock wordfrequency wxwidgets






