Camillo wrote:
in this case it is only the instance of Job which knows the status. Thread-safeness is not an issue since the progress bar is pure approximation.
The problem is not approximation. Objects are not reentrant, getting the value out of a model while it is reorganizing its datastructure is likely to give interesting and difficult to reproduce results (dividing by 0, nil-pointer exceptions).
that does not work properly and inaccurately reports long running jobs, for instance when running tests. Usually tests take far less than 1 ms, in which case this scheme works perfectly. However from time to time you have 1 test that runs for a couple of seconds. If you run 5000 tests you have to run quite a few tests to get that 1% update margin, so very often the UI does not correctly report the current status.
That is not a solvable problem. A progress bar depends on a value increasing from min to max. The model is responsible for making reasonable steps.
Anyway, this requires quite some changes in the current ProgressBarMorph, so any other improvement until then is welcome :)
I've put together a new slice in the 30 Inbox with the combined changes. Where should I put a backport for 2.0?