In old Ocaml it used to work catching a Unix signal that was raised at the
end of each timeslice. It works no more in Ocaml5.
- we now use a fixed timer (every 1s) to trigger the Unix signal
- the signal is usually caught by the non-worker thread and for some reason
blocking the signal interferes with Gtk
- solution: if the signal is caught by the non-worker thread, the thread
goes to sleep for 3s to let the worker thread catch the signal
Most of the time the trick works, even if some delay is introdued.