[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Parted 1.6.0-pre9
From: |
Andrew Clausen |
Subject: |
Re: Parted 1.6.0-pre9 |
Date: |
Thu, 18 Apr 2002 07:32:38 +1000 |
User-agent: |
Mutt/1.3.28i |
On Tue, Apr 16, 2002 at 09:53:01PM +0100, Richard Hirst wrote:
> On Sat, Apr 13, 2002 at 08:18:13AM +1000, Andrew Clausen wrote:
> > > Actually, progress reporting is
> > > pretty eratic on this dual processor ia64 box, with 2G memory. When
>
> The following line from ped_timer_update() is suspect:
>
> timer->predicted_end
> = timer->start + (timer->now - timer->start) / frac;
>
> That is effectively "long = long + long/float", and on ia64 it appears
> to evaluate it all as float. float seems to only have 24 significant
> bits, and as time() is bigger than that, predicted_end gets rounded.
Interesting.
> tcontext->predicted_time_left / 60,
> tcontext->predicted_time_left % 60);
> - fflush (stdout);
>
> if (timer->predicted_end == timer->now) {
> wipe_line ();
> tcontext->finished = 0;
> }
> + fflush (stdout);
> }
> }
>
>
> Without that, the output of that wipe_line() call above just sits in the
> output buffer until parted prompts again. With that change, progress
> increments to 100%, clears, and then there is a pause while the disk
> chugs away, then a new (parted) prompt. I got the impression the
> progress line flickered more with that fflush() change, so maybe it is
> better not to change it.
How can that be? In theory, that last if only occurs at the end.
(And the conditional evaluation time isn't worth talking about! ;)
Perhaps, as you get to the end, the predicted end is occassionaly
at the end of the second, etc... I should just be comparing frac.
(Subjectively, it works better now)
if (tcontext->started && !tcontext->finished) {
wipe_line();
if (timer->frac >= 1.0) {
tcontext->finished = 0;
} else {
if (timer->state_name)
printf("%s... ", timer->state_name);
printf(_("%0.f%%\t(time left %.2d:%.2d)"),
100.0 * timer->frac,
tcontext->predicted_time_left / 60,
tcontext->predicted_time_left % 60);
}
fflush(stdout);
}
I'm worried about that timer->frac >= 1.0 condition... some language
lawyer is going to eat me for that. (Someone is going to get
10.0 / 10.0 < 1.0, or something nasty...)
Thanks,
Andrew