4 ms·
One I remember was a thing we hit with Netscape Navigator. One of our products was a web proxy that ran on localhost. You set your web browser to go through the
by tzs 5y ago
One I remember was a thing we hit with Netscape Navigator. One of our products was a web proxy that ran on localhost. You set your web browser to go through the proxy, and the proxy would cache and prefetch to try to make your browsing experience nicer.
We found that with Navigator network performance through the proxy was completely terrible--unless you were waving the mouse around. If you were waving the mouse around then it was fine.
I don't remember all the details, but I think it turned out that this only was the case when Navigator was going through a proxy on 127.0.0.1. If we changed it to use the host's external IP address then it worked fine regardless of what you were doing with the mouse.
Internet Explorer did not have this issue. We had another thing we were working on that involved an email proxy, and no email clients we tried had any oddities with 127.0.0.1 proxies.
Later, we switched away from explicitly configuring browsers to use the proxy. Instead we switched to an LSP [1]. 127.0.0.1 then worked fine on Navigator, so whatever the issue was it only happened when Navigator knew it was talking to 127.0.0.1.
[1] https://en.wikipedia.org/wiki/Layered_Service_Provider https://en.wikipedia.org/wiki/Layered_Service_Provider
- jcims 5y agoOver the past ~30 years of internetting, I’ve developed a reflexive habit of wagging the mouse over the screen of anything that has stalled progress, particularly in web browsers. It clearly has some kind of impact at times and is always with a shot. I’m guessing it pings the application in some kind of ui event loop.
- pjc50 5y agoIt absolutely does - the app gets a bunch of Windows messages, and the Windows scheduler boosts the priority of whatever the foreground interactive process is. https://docs.microsoft.com/en-us/windows/win32/procthread/priority-boosts https://docs.microsoft.com/en-us/windows/win32/procthread/pr... "Fair" scheduling in these situations is a nightmare that I think I've only seen BeOS and the research OS Nemesis handle correctly.
- sumtechguy 5y agoYour guess seems better than mine. I was thinking they wrote the code wrong and somehow attached itself to the message pump in the processing path. Hmm, that could still be it and they were using a timer to tickle it here and there. But that is all speculation. But waving the mouse around to make run faster really sounds like a message pump issue. Or maybe they used getmessage instead of peekmessage?
- ComputerGuru 5y agoSee my other reply - it was an async IO stack failure; Windows had completion-based async IO long before io_using came around but it has gotchas that would cause completion events to not reach except in tandem with user input on the message pump. https://devblogs.microsoft.com/oldnewthing/?p=36423 https://devblogs.microsoft.com/oldnewthing/?p=36423
- sumtechguy 5y agoAh that makes sense. Figured it had something to do with the message pump (the mouse move is a classic tipoff of that pattern). Yeah those message semaphore functions are seriously neat. But they have a few sharp edges around when they are not listening (race condition usually). I had something similar with pulseevent a few years ago. Pulsing while processing would sometimes miss the event because there was nothing waiting it was busy doing things, and would loop around to wait again but not do anything because it 'ignored' the pulse. In that example you posted it depends on when the 'extra' message shows up. Depending if it is before or after the peek it will sometimes work (race condition).
- ComputerGuru 5y agoPeekMessage and PulseEvent are convenience functions that should have never been written. I intentionally excluded PulseEvent from my posix port of WaitForMultipleObjects because it is inherently racy: https://github.com/NeoSmart/PEvents https://github.com/NeoSmart/PEvents (It can be enabled via a compile-time define because my OCD kept me from shipping an incomplete port.)
- verelo 5y agoI don’t have a source for this but i recall the story being that the mouse was a source of random data used by various cryptography libraries. If the recorded randomness was exhausted some functions were delayed until more was provided eg the mouse was moved. Can anyone confirm / debunk this?
- pjc50 5y agoUnder some circumstances, this can be true on Linux: https://pthree.org/2014/07/21/the-linux-random-number-generator/ https://pthree.org/2014/07/21/the-linux-random-number-genera... (see "input pool")
- ComputerGuru 5y agoIt’s true - until today, Windows 95 setup hangs in a VM if input is not connected until you just click in it once. It’s not cause by strong cryptographic sources (this is Windows 9x where the logon username and password was optional!) but rather a more insidious issue with how async IO was handled in apps. Windows had async IO support long before that was on the radar for a lot of other operating systems, but it isn’t as easy to use, leading to issues like this. https://devblogs.microsoft.com/oldnewthing/?p=36423 https://devblogs.microsoft.com/oldnewthing/?p=36423