Liste des Groupes | Revenir à cl c |
On 2024-12-08, Chris M. Thomasson <chris.m.thomasson.1@gmail.com> wrote:Exactly. Actually, I remember a while back (several decades ago) when I was experimenting with lock/wait-free algorithms in sig handlers. They worked fine. Some of the algorithms would allow one to conditionally wait (futex, eventcount, ect...) say wait on a lock-free stack empty condition. So those could not be used. However, the "try" versions of them would work fine. :^)On 12/7/2024 7:49 PM, Kaz Kylheku wrote:Yes; just not sem_wait. The obvious idea there is that a signal handlerOn 2024-12-07, James Kuyper <jameskuyper@alumni.caltech.edu> wrote:>My words above not-withstanding, I am not in any sense an expert on any>
kind of threading, nor of Windows. What does POSIX require of threads
with regards to signals?
Off the top of my head, the highlights:
>
- threads have their own signal masks, inherited from the creator which
calls pthtead_create.
- signal masks can be manipulated so that a given signal will be
handled in the context of a desired thread.
- sigwait (and several other functions) can be used by a thread to
wait for one or more signals, allowing signals to be process
synchronously, somewhat like message passing.
>
Semaphores are sig safe, so to speak. It's been a while:
>
https://www.man7.org/linux/man-pages/man3/sem_post.3.html
>
should be sig safe? Or, am I wrong here Kaz?
is like an interrupt service top half, and those must be able to bang
semaphores, to wake up something waiting in the bottom half code.
Les messages affichés proviennent d'usenet.