.. include:: Use Case: Self-Pipe Trick ========================= Problem ------- * Want to do more in signal handlers * Probably not a good idea: cannot do more in signal handlers (see :ref:`here `) Solution -------- * Defer signal handling to main loop * Transport medium: `pipe `__ between signal handler context and program context .. literalinclude:: code/self-pipe.cpp :language: c++ :caption: :download:`code/self-pipe.cpp`