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]

Re: how to obtain pthread_suspend


Am Freitag, den 13.09.2013, 16:59 -0400 schrieb Carlos O'Donell:
> On 09/13/2013 05:11 PM, JoÃl KrÃhemann wrote:
> > Hi
> > 
> > I'm looking for pthread_suspend does it exist in glibc?
> > 
> > I'm just building a linux from scratch and my last step was compiling
> > glibc but can't find pthread_suspend and pthread_resume.
> > 
> > For more details see:
> > http://sourceforge.net/p/ags/code/HEAD/tree/src/ags/thread/ags_thread.c 
> > 
> > within function:
> > ags_thread_real_timelock(AgsThread *thread)
> 
> The functions pthread_suspend and pthread_resume are 
> not part of POSIX and not provided by glibc's NPTL
> POSIX threading implementation.
> 
> POSIX provides no way for you to suspend or resume 
> another thread without coordination from that thread.
> 
> The only way to do this easily is with signals.
> Perhaps see if SIGSTOP and SIGCONT can be applied to
> threads, if not try sending a signal to the target
> thread and having it wait in the signal handler
> until told to resume? Careful that you can only
> run async-signal-safe operations in that handler.
> 
> I wouldn't be opposed to someone proposing adding
> pthread_suspend_np and pthread_resume_np to glibc,
> but it requires kernel work.
> 
> Cheers,
> Carlos.
I'll do a work-around but as long I can't suspend/resume the GUI loop,
it will block AgsTaskThread. I think that async-signal operations need a
point where it is synced else it won't be safe or you are doing some
ugly mutices scattered all along the code.

regards
JoÃl



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