On 24-05-18 11:25, Andrea F. wrote:
I have a small app that does some work on a secondary thread (spawned using spawn() phobos function).
I want to update UI with progress from this thread: which is the right way? Is there any example?
I'm not sure if gtk signals are ok with threads and I can't understand how to build a custom signal with gtk.
Thanks,
Andrea
For communication between threads it would be best to use
std.concurrency. Where you would put the receive function in an idle
handler like: glib.Idle or gdk.Threads.threadsAddIdle.
An example of this is the Multi threaded demo:
https://github.com/gtkd-developers/GtkD/blob/master/demos/gtkD/DemoMultithread/DemoMultithread.d