Date: Tue, 02 Jul 2013 21:08:36 +0300 From: Andriy Gapon <avg@FreeBSD.org> To: attilio@FreeBSD.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: should_yield problem [Was: svn commit: r251322 - head/sys/kern] Message-ID: <51D31724.6090807@FreeBSD.org> In-Reply-To: <CAJ-FndATxzTwCkZGXw4jD_8O4KbnHbsjk4DwHwbp%2B0gd3VGTCQ@mail.gmail.com> References: <201306031736.r53Hain5093431@svn.freebsd.org> <51D30463.50608@FreeBSD.org> <CAJ-FndD5tCxe-L8V73MFtk_4xr0Wq3MHasKY4O_tcA3uYouKAw@mail.gmail.com> <51D30CE8.7030803@FreeBSD.org> <CAJ-FndATxzTwCkZGXw4jD_8O4KbnHbsjk4DwHwbp%2B0gd3VGTCQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
on 02/07/2013 20:52 Attilio Rao said the following: > I was just pointing out that the real bug is not in the subtraction > itself but on the hogticks comparison. > This is because hogticks is not an absolute measurement but it > represents really a ticks difference. > In my opinion we should define hogticks as an unsigned int and add a > small comment saying that it is a differential. > This will fix the issue. I think that my original suggestion is equivalently well if not more obvious. This is a common knowledge: http://en.wikipedia.org/wiki/Serial_number_arithmetic#General_Solution distance = (signed)( i1 - i2 ) -- Andriy Gapon
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51D31724.6090807>