edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev] Churning Timers
Date: Mon, 30 Jan 2017 06:00:40 -0500	[thread overview]
Message-ID: <20170030060040.eklhad@comcast.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1982 bytes --]

Ok,here is the problem of the day.
If you don't apply my latest push / fix, and go to this site, it locks you out in what seems like an infinite loop.
You can type and type and nothing happens.
Hit control c and get the usual "type qt to quit" message, but still you have no access.
You have to kill the process. At least that's what happens over here.

http://www.huffingtonpost.com/entry/the-inevitability-of-impeachment_us_588e8d52e4b0b065cbbcd09f

I thought my code was traversing a broken tree forever, again, or some such, but no.
I fixed those problems.
This site has a half doesn't timers, actually intervals, that fire every 50ms.
My implementation is sufficiently slow, or perhaps I have the wrong priorities on select() channels, or some such, that I am locked out.
As a bandaid, I now wait at least 230ms before running timers.
That is the latest push.
It's just a couple lines of code.
I actually don't think this is a bad idea.
Timers firing every 50ms almost surely exist to render fast visual effects, which are lost on us.
If it takes a couple minutes to read a message on the screen, or understand what part of the screen has changed,
then there's just no reason to change the screen 20 times a second.
Slowing down the process fixes the problem.
I can enter commands and edbrowse responds.
Type db4 and oh yes you can see the timers firing, and the screen rerendering, even though nothing on the screen changes.
Type db1 to go back to quiet.
It works, though even at this level it consumes 10% of my processor.
If I happen to have 10 such web pages open, either in parallel or pushed up onto the stack, the whole processor is churning.
So we don't have a clear solution yet.
Obviously the real browsers fire these timers 20 times a second without making a dent in cpu usage and without blocking user input.
No idea how they do it.

Anyways, the web page works now, and as for its contents, I can only hope he's right.

Karl Dahlke

             reply	other threads:[~2017-01-30 10:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 11:00 Karl Dahlke [this message]
2017-01-30 23:33 ` [Edbrowse-dev] Churning timers / I'd like to submit 3 things today Kevin Carhart
2017-01-30 23:37   ` Kevin Carhart
2017-01-31  2:31     ` [Edbrowse-dev] Churning timers / I'd like to submit 3 things Karl Dahlke
2017-01-31 18:47       ` Adam Thompson
2017-01-31 19:27 ` [Edbrowse-dev] Churning Timers Adam Thompson
2017-02-01  0:38   ` Kevin Carhart
2017-02-01  0:52     ` [Edbrowse-dev] acidtests script 8 Kevin Carhart
2017-02-02  1:16       ` [Edbrowse-dev] acidtests.org Kevin Carhart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170030060040.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).