The last few weeks we have seen an extremely verbose thread of
conversation on gtkmm-list (How to update both the Console and the
GTKMM gui window after running other functions). I have not read all
the countless posts in that thread of conversation, but it made me
aware that the gtkmm tutorial contains a chapter on multi-threaded
programs,
https://developer.gnome.org/gtkmm-tutorial/stable/chapter-multi-threaded-programs.html.en,
but no example program. Now I have added an example program at
https://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/multithread.
I also added a short explanation in the tutorial. Since it may take
some time before that explanation will be easily available on the
web, I show it here:This is an example program with two threads, one GUI thread, like in all gtkmm programs, and one worker thread. If you find bugs in the example program, I'd like to know. I have strived to make it thread-safe. |