Kill all parents child threads from a child thread in C++

  • Context: C/C++ 
  • Thread starter Thread starter Superposed_Cat
  • Start date Start date
  • Tags Tags
    C++ Thread Threads
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 2K views
Superposed_Cat
Messages
388
Reaction score
5
I have a C++ program that starts two threads from the parent thread, I need to kill both children from a child thread.

____> b
|
a -
|_____> c

I need to kill b & c from b. Issue is, I can't use simple flags, as c waits for input using cin.
Any help appreciated.
 
Physics news on Phys.org
Can't you pass a message back to a and have a kill both threads when it receives the message?
 
  • Like
Likes   Reactions: DEvens