On Tue, Feb 9, 2021 at 6:07 PM Bruno Haible <br...@clisp.org> wrote: > Maybe I didn't describe accurately the situation I am asking for. > I'm not attempting to transform a program to an event-based engine. > I'm looking to let signal handlers (SIGTERM, SIGSEGV, SIGWINCH, etc.) > read and traverse data structures that the main program has prepared > (and that contain information about files to delete, memory areas, > window lines to redraw etc.).
This is a situation that I've always worked hard to avoid. So little can be safely done in a signal handler that it's worthwhile to try not to do more than the minimum possible. Have you already concluded that you must do significant work in a signal handler? I would not want to try to, say, redraw lines in a window in a signal handler, because the functions that I would need to call to do that would not be prepared to run inside such a handler: I don't think ncurses or GTK+, for example, would be happy at all about it.