cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
UNIX/Linux Programming
how to create parent and only one child
how to create parent and only one child pthread in C++
Nov 6, 2016 at 10:09pm UTC
mayankbsq
(6)
Hello,
I do not know so much about pthread.
My question is:-
How to create a parent and only one child pthread in c++?
If I will create one thread named main_thread and inside the function of that main_thread thread, I will create only one child thread.
Does is called parent-child thread or not?
Nov 7, 2016 at 12:15pm UTC
kbw
(9488)
The program is running in a thread, we call that the main thread.
Each time you call "pthread_create", it'll create a child thread.
Nov 7, 2016 at 5:49pm UTC
mayankbsq
(6)
Can you please share code (main pthread and only one child pthread example) with the comment? So I can understand easily. Thanks in advance.
Last edited on
Nov 7, 2016 at 5:51pm UTC
Nov 9, 2016 at 4:44pm UTC
PanGalactic
(1658)
Is there a reason you are not using std::thread or, if you are using C++03, not using the Boost Thread library (which has a very similar API)?
Nov 12, 2016 at 7:50pm UTC
kbw
(9488)
If you're going to work on Unix systems, you really should start using manual pages.
http://man7.org/linux/man-pages/man3/pthread_create.3.html
Last edited on
Nov 12, 2016 at 7:51pm UTC
Topic archived. No new replies allowed.