S
S
Sdelan_v_CCCP2014-09-23 07:46:58
linux
Sdelan_v_CCCP, 2014-09-23 07:46:58

Can pThread be paused from another thread?

Good day! Interested in such a question, is it possible in a POSIX thread to pause another thread by its ID. And also make it so that after creation, the thread was in a state of pause, and start it from another thread when I need it.
PS: Linux, C programming language.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
jcmvbkbc, 2014-09-23
@Sdelan_v_CCCP

pthreads doesn't have one portable function for what you want to do. The first part (pausing another thread by its ID) can be implemented using signals, the second (so that after creation the thread is in a paused state) using synchronization primitives.
Searching for pthread_suspend will lead you to possible implementations.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question