On 20-06-2020 18:34, adnan338 wrote:
Hello, I need a code review on my strategy of updating a GtkD progressbar. Gtk is not thread safe, I interpret that as "I must only access data available in the main thread from the Gtk objects".
This example is a simplified excerpt of my project. I have never done concurrency before and thus I would like a code review. The goal here is
- Downloading a list of file in parallel
- Update the gtk progressbar periodically to show the overall download progress.
Original thread: https://email@example.com
Using glib.Timeout or glib.Idle is probably the best approach to update
the main thread/GUI.
If you are worried about a data race you could use, std.concurrency.send