
Boost.Signal is clamed to be non thread safe. Boost.Thread does not have semaphores. So how in the world I can synchronize signal handlers with threads? I have found an old discussion about this issue in the mailing list archive but it has no conclusion and no practical advises. Do people think this is non issue? Cheers, Sergei

On Mon, 07 Feb 2005 10:14:28 +0100, Serguei Kolos <Serguei.Kolos@cern.ch> wrote:
Boost.Signal is clamed to be non thread safe. Boost.Thread does not have semaphores. So how in the world I can synchronize signal handlers with threads? I have found an old discussion about this issue in the mailing list archive but it has no conclusion and no practical advises. Do people think this is non issue?
Not sure I understand what you're asking, but I think a condition from boost::thread will do what you want. Matt. matthurd@acm.org

Unfortunately this is not true. Mutex and Condition are not async-signal safe. They can not be used in signal handlers. Matt Hurd wrote:
On Mon, 07 Feb 2005 10:14:28 +0100, Serguei Kolos <Serguei.Kolos@cern.ch> wrote:
Boost.Signal is clamed to be non thread safe. Boost.Thread does not have semaphores. So how in the world I can synchronize signal handlers with threads? I have found an old discussion about this issue in the mailing list archive but it has no conclusion and no practical advises. Do people think this is non issue?
Not sure I understand what you're asking, but I think a condition from boost::thread will do what you want.
Matt. matthurd@acm.org _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Hi, On Feb 7, 2005, at 11:14 AM, Serguei Kolos wrote:
Boost.Signal is clamed to be non thread safe. Boost.Thread does not have semaphores. So how in the world I can synchronize signal handlers with threads?
I assume you're talking about POSIX signals, not Boost.Signal here. Boost.Signal is a signal/slot mechanism, providing similar functionality to Qt signals and slots (but in pure C++). Boost does not offer any assistance for asynchronous signal handling.
I have found an old discussion about this issue in the mailing list archive but it has no conclusion and no practical advises. Do people think this is non issue?
Cheers, Sergei
- Michael

Hello
Boost.Signal is clamed to be non thread safe. Boost.Thread does not have semaphores. So how in the world I can synchronize signal handlers with threads?
I assume you're talking about POSIX signals, not Boost.Signal here.
Boost.Signal is a signal/slot mechanism, providing similar functionality to Qt signals and slots (but in pure C++).
You are right, my quick impression was wrong.
Boost does not offer any assistance for asynchronous signal handling.
This is shame. That's why I don't understand why Boost.Thread does not support semaphores anymore. Without semaphores correct handling of POSIX signals in MT application is impossible. Cheers, Sergei

Serguei Kolos wrote: [...]
This is shame. That's why I don't understand why Boost.Thread does not support semaphores anymore.
How about (quoting C++ std) "The common subset of the C and C++ languages consists of all declarations, definitions, and expressions that may appear in a well formed C++ program and also in a conforming C program. A POF (``plain old function'') is a function that uses only features from this common subset, and that does not directly or indirectly use any function that is not a POF. All signal handlers shall have C linkage. A POF that could be used as a signal handler in a conforming C program does not produce undefined behavior when used as a signal handler in a C++ program. The behavior of any other function used as a signal handler in a C++ program is implementation defined." Implementation defined is not good for boost, oder? ;-) Get rid of async signal handling. Use SIGEV_THREAD and/or sig{timed}wait{info}()) and dedicated signal handling thread(s). As for synchronous signals, use SEH-like implementation defined EH extensions to handle them in structured fashion. regards, alexander.
participants (4)
-
Alexander Terekhov
-
Matt Hurd
-
Michael van der Westhuizen
-
Serguei Kolos