Suspend/resume a pthread thread

Bharath Ramesh bramesh@vt.edu
Tue May 11 04:38:00 GMT 2010


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4440 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-help/attachments/20100511/5a039b45/attachment.bin>


More information about the Libc-help mailing list