in reply to How treat CPU-intensive callback in Gtk2 or others
Generally, it's best to make the event callbacks handle only GUI activity, and send appropriate messages to threads for non-GUI activities. In practice, though, you'll find it useful to do trivial non-GUI stuff in event callbacks. (Though I recommend even keeping the non-GUI stuff out of the event processing loop--once you build enough infrastructure to do your non-trivial tasks in a different thread, it's generally easy enough to keep the trivial stuff there too. That way, you have fewer headaches (variable synchronization, sequencing processing tasks, etc.)
...roboticus
|
|---|