This is the mail archive of the libc-help@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Suspend/resume a pthread thread


I believe currently there exists no such pthread API like
pthread_continue/resume/suspend. What would be the ideal way to
suspend/resume a thread from another thread in a multi-threaded application.
Of course for this to work one should ensure that program will not deadlock,
this is something I can guarantee as a programmer. One cannot use
pthread_kill as no thread can individually block SIGSTOP. I was wondering if
any API similar to one present in HP-UX [1] exists for NPTL. I could
probably use something like SIGUSR1/SIGUSR2 to sched_yield till the
condition for resume is satisfied, this would only move my thread to the end
of the ready queue. I wanted to know if there was any better way of
achieving this. Any thoughts on this is greatly appreciated. It would be
great if such calls could exists NPTL similar to some of the other
non-portable APIs.

Regards,

Bharath

P.S: I am not subscribed to the mailing list, would appreciate it if I am
copied in the reply.

[1] http://docs.hp.com/en/B2355-90695/pthread_resume_np.3T.html

Attachment: smime.p7s
Description: S/MIME cryptographic signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]