Boost logo

Boost :

From: Aristid Breitkreuz (aribrei_at_[hidden])
Date: 2006-05-09 16:35:16


Am Dienstag, den 09.05.2006, 19:22 +0000 schrieb Ryan Gallagher:
> Gennadiy Rozental wrote:
> > SIGNAL catching is optional and doesn't constitute portabiltiy issues per se,
> > whether to use it's up to you.
>
> Out of curiousity, what is a good (portable?) way of dealing with signals in
> C++? C signal handling seems to force globals on you, which is a pain
> especially when signal handling is a late requirement.

You might want to use a UNIX pipe for that (by calling pipe(2)). Just
write(2) into a pipe (less than PIPE_BUF bytes) and select(2) on it.
This is thread-safe and signal-safe and everything. Just not too speedy.

> [snip]

> If possible I'd
> like to see a solution like this that works on boost's supported platforms
> and released as part of boost.
>

Are signals sensible on Windows? I thought they were important on UNIX
only. Might err though.

> -Ryan
>

- Aristid


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk