Re: [Java-gnome-developer] updating GNomeAppBar.progressbar while running a long process.
Brought to you by:
afcowie
From: Ismael J. <ml...@ju...> - 2005-04-19 11:45:57
|
On Tue, 2005-04-19 at 08:30 -0300, Joao Victor wrote: [...] > > I know about that... but i think in this situation it's not a problem, because there is only 1 > thread changing fraction, the other is just reading. IMHO, in the worst case, the thread that > reads will read an old value... which is alright, since it'll read the right value anyway when the > Timer ticks again. I might be wrong though. [...] The point is you don't know when the other thread will read the right value. For all you know, the thread could read its 'local' copy several times before it reads the updated one. Even though it might work fine in a certain implementation, it is really undefined behaviour and definitely not recommended. I understand that this is not mission-critical as it is only a progress bar, but I don't think we should recommend people to do that in a tutorial. All of this imho of course. Regards, Ismael |