Re: GtkD code review - How to update a progressbar using data sharing concurrency

2020-06-22 Thread Ali Çehreli via Digitalmars-d-learn
On 6/21/20 5:52 AM, adnan338 wrote: I am trying to figure out how to prevent this data race. I still like the std.concurrency method I used here: https://forum.dlang.org/post/rkitcprqvslexgqaf...@forum.dlang.org The only difference is that your individual progresses are from 0% to 100%. T

Re: GtkD code review - How to update a progressbar using data sharing concurrency

2020-06-21 Thread adnan338 via Digitalmars-d-learn
On Sunday, 21 June 2020 at 12:43:32 UTC, adnan338 wrote: On Sunday, 21 June 2020 at 09:16:06 UTC, Ali Çehreli wrote: On 6/20/20 9:30 AM, adnan338 wrote: > Hello, I need a code review on my strategy I don't know gtkd so I did not compile the code and I did not review the code very carefully.

Re: GtkD code review - How to update a progressbar using data sharing concurrency

2020-06-21 Thread adnan338 via Digitalmars-d-learn
On Sunday, 21 June 2020 at 09:16:06 UTC, Ali Çehreli wrote: On 6/20/20 9:30 AM, adnan338 wrote: > Hello, I need a code review on my strategy I don't know gtkd so I did not compile the code and I did not review the code very carefully. However, I don't think you need to 'synchronized' the who

Re: GtkD code review - How to update a progressbar using data sharing concurrency

2020-06-21 Thread Kagamin via Digitalmars-d-learn
Not sure how much synchronization do you want to do. import gio.Application : GioApplication = Application; import gtk.Application : Application; import gtk.ApplicationWindow : ApplicationWindow; import gtk.ProgressBar : ProgressBar; import glib.Timeout : Timeout; import gtkc.gtktypes : GApplicat

Re: GtkD code review - How to update a progressbar using data sharing concurrency

2020-06-21 Thread Ali Çehreli via Digitalmars-d-learn
On 6/20/20 9:30 AM, adnan338 wrote: > Hello, I need a code review on my strategy I don't know gtkd so I did not compile the code and I did not review the code very carefully. However, I don't think you need to 'synchronized' the whole parallel loop. Since there is only one thread that execut

GtkD code review - How to update a progressbar using data sharing concurrency

2020-06-20 Thread adnan338 via Digitalmars-d-learn
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