[haiku-bugs] Re: [Haiku] #89: Charts blocks drawing while '2 Threads' is selected [...]

  • From: "stpere" <trac@xxxxxxxxxxxx>
  • Date: Thu, 02 Jul 2015 20:52:31 -0000

#89: Charts blocks drawing while '2 Threads' is selected [...]
----------------------------------+----------------------------
Reporter: johndrinkwater | Owner: jackburton
Type: bug | Status: closed
Priority: normal | Milestone: R1
Component: Applications/Chart | Version: R1/Development
Resolution: fixed | Keywords:
Blocked By: | Blocking:
Has a Patch: 0 | Platform: All
----------------------------------+----------------------------
Changes (by stpere):

* status: reopened => closed
* resolution: => fixed


Comment:

I put a workaround in hrev49353. Basically, you could have a situation
like this :
bigtime_t before = system_time();
SomeCalculation();
SomeOtherCalculation();
bigtime_t after = system_time();

and you could have some cases where after - before < 1 (either 0 or
negative). When used in the division right after, you would have a
division by 0 (NaN) that would break the logic further down and poison the
animation as the ratio is calculated from the ratio calculated in the
previous cycle.. NaN * NaN, etc..

So, I made sure the after-before was at least 1 and it seems to work ok.
Since the time calculation was more or less only there to calculate a load
ratio, it doesn't have to be extra accurate.

--
Ticket URL: <https://dev.haiku-os.org/ticket/89#comment:33>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: