how to create parent and only one child pthread in C++

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?
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.
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
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)?
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
Topic archived. No new replies allowed.