emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SIGPROF + SIGCHLD and igc


From: Eli Zaretskii
Subject: Re: SIGPROF + SIGCHLD and igc
Date: Fri, 27 Dec 2024 17:19:58 +0200

> From: Helmut Eller <eller.helmut@gmail.com>
> Cc: gerd.moellmann@gmail.com,  pipcet@protonmail.com,  ofv@wanadoo.es,
>   emacs-devel@gnu.org,  acorallo@gnu.org
> Date: Fri, 27 Dec 2024 15:53:43 +0100
> 
> On Fri, Dec 27 2024, Eli Zaretskii wrote:
> 
> > But I don't understand
> > why you need that pipe: doesn't pthreads allow one thread to stop the
> > other?  If so, just make the "profiler thread" stop the main thread
> > instead of your step 2, and resume the main thread instead of your
> > step 4.  Am I missing something?
> 
> You mean there is a phtread_stop function that is similar to
> SuspendThread on Windows?  I've not found anything like that; but that
> doesn't mean that there isn't one.  The Linux man-pages for pthreads are
> notoriously useless.

This:

  
https://stackoverflow.com/questions/18826853/how-to-stop-a-running-pthread-thread

seems to say you need to call pthread_kill with SIGSTOP/SIGCONT,
he-he.

> I like the pipe because it's a signal safe and thread safe communication
> mechanism.  It avoids the need for mutexes or stdatomic stuff; that's
> best left to wizards.

This could work for Posix systems, but I don't think it works for
Windows to have a pipe between two threads.  And Windows already has
SuspendThread, so maybe a pipe is not needed there.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]