I
I
ivanesc3nce2022-03-27 13:52:31
C++ / C#
ivanesc3nce, 2022-03-27 13:52:31

How to terminate all threads immediately after one of the threads ends in C using only pthread_detach and pthread_join?

Solving the problem of dining philosophers, I came across such a problem. It is necessary that when one philosopher dies, all other threads stop, and the program ends.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wataru, 2022-03-27
@wataru

If you call exitany, the program will end and the system will kill all threads.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question