[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[Libevent-users] Threads and Signals



My code includes a single event loop and multiple threads.
It's a unit-testing piece of code and I am trying to understand the expected
behavior.
Running on Linux with libevent 2.0

What the code roughly does is
- Set an event to call func1 for handling SIGUSR1
- Sends itself SIGUSR1
- Verifies it was received.
- Creates 10 identical threads.
- Each threads sets up an event to call func1 when SIGUSR1 arrives
- The main threads loops through the 10 threads, and uses pthread_kill to
send each one SIGUSR1

Should I expect to see func1 called 11 (initial + one per thread ) times in
the code ?
When signals are sent to the threads, can I expect func1 to be called once
by each thread ?

***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.