lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev dev.16 patch 3 - SOURCE_CACHE etc.


From: Klaus Weide
Subject: Re: lynx-dev dev.16 patch 3 - SOURCE_CACHE etc.
Date: Thu, 9 Dec 1999 20:34:36 -0600 (CST)

On Thu, 9 Dec 1999, Leonid Pauzner wrote:

> 9-Dec-99 06:30 Klaus Weide wrote:
> 
> > * Corrected line counting in HTDisplayPartial, taking into account offsets
> >   used for the various variables being compared.
> 
> > Index: 2.31/WWW/Library/Implementation/HTFormat.c
> > @@ -528,11 +528,11 @@
> >       **
> >       **  So repaint the page only when necessary:
> >       */
> > -     if (((Newline_partial + display_lines) > NumOfLines_partial)
> > +     if (((Newline_partial + display_lines) - 1 >= NumOfLines_partial)
>                                                    ^^
> >               /* current page not complete... */
>                                ^
> That is an equivalent changes above,

Yes it is.  I didn't notice...

> perhaps '>' should be used instead of '>=' here,
> otherwise "current page is complete".

Yes...  I didn't understand at first, but after playing it through with
some numbers it seems you are right.

[ I have to do it slowly and by hand...
Consider as simple case:
  display_lines == 30   (I use a 100x32 screen)
  Newline_partial == 1  (display starts with top of document)

Then
 * NumOfLines_partial == 30 means that there were already 30 complete
   lines (plus possibly another incomplete last_line) at the last screen
   update.  So everything in the visible window is already complete.

Filling in the variables gives (-, +: see above; Y: your proposed change)

-       if (((1 + 30) > 30)                    TRUE
+       if (((1 + 30 - 1) >= 30)               TRUE

Y       if (((1 + 30 - 1) > 30)                FALSE - ok
]

> Thanks for the fix below.
> [This tiny calculations aren't so shape as we could think since having
> two asynchronous processes one could get another read from the socket
> while executing display_page() so HText_getNumOfLines() may be increased
> then. We are working with the pessimistic estimation, though.

But we don't have anything like asynchronous processes.  If we had, a *lot*
of other changes would be necessary...

But whatever you do, you wouldn't want to allow display_page() and appending
data to HTMainText to happen at the same time.  You'd have to block one
while the other is happening.

I don't fully understand what you mean with "pessimistic" and "optimistic"
here.

> One could work from the optimistic estimation if moving
> LYMainLoop_pageDisplay() call before NumOfLines_partial = HText_getNumOfLines
> Does this have any sence?]

Why would it make a difference?  LYMainLoop_pageDisplay() doesn't modify
HTMainText->Lines afaics.  And of course it shouldn't.  So the order doesn't
matter with the current state of affairs, right?  With "asynchronous processes"
(I assume you mean threads) accessing the same HText structure - well that's
so far from what we have now that all bets are off (or I'm not thinking as
far ahead as you).

   Klaus


reply via email to

[Prev in Thread] Current Thread [Next in Thread]