Live data from Hacker News

If you move your mouse continually the query may not fail. Do not stop moving

support.microsoft.com

161–168 of 168 posts

Re: If you move your mouse continually the query may not fail. Do not stop moving

#161
post #138
post #92

Earlier quoted context omitted.

I am familiar with the design of message queues, though not specifically with the design of Windows message pumps. > If you violate the run loop's threading requirements it's not totally inconceivable that a mouse event could affect behavior. That's true. But the possibility remains that the design of Windows message queues is so byzantine and imposes so many arcane requirements on the developer that it is easy to mi…

It looks more to me that there's some problem with the background polling mechanism in the app, as implied by solution #1. Presumably something in the mouse event handler does something that prods the polling code into life, perhaps because something somewhere is trying to update the list of things on screen in order to handle hovering. Kind of hard to say without looking at the code, though... (The Windows message q…

As someone who has worked with Win32 for a long time, I think the problem is quite simple; in the message loop body someone put something like

    if(dataAvailable())
     fetchData();
and assumed regular window messages to drive execution of this process. If you don't move the mouse or do anything else with the window, no messages are sent to it (unless a timer or something else does) and the message loop just waits for the next message, so that code doesn't get run. If you move the mouse around in the window a constant stream of WM_MOUSEMOVE will drive the loop. Polling really shouldn't be done in the main message loop; one way to fix this is to move to a completely event-driven system where dataAvailable() sends a message that causes the main loop to run fetchData().

Re: If you move your mouse continually the query may not fail. Do not stop moving

#162
post #131

Earlier quoted context omitted.

> You overlooked the fact that programming model of windowed/GUI applications is quite complex and very sensitive to non-cooperative code - a thread that frequently blocks for 100 ms can cause very unpleasant hiccup. No, I didn't overlook this. But this is 2013. IMO, a multitasking architecture that is "sensitive to non-cooperative code" ought to be considered broken, and so if that's the cause of this problem, that…

In that case I look forward to the lisper UI toolkit, which stays responsive when application code stalls on a UI thread. I'll bet it goes well with the lisper dynamic linker, which I hear completely isolates me from bugs of code living in the same address space. Kidding aside, I can't help but think that you keep going back to that "clearly the mutex is broken" analogy I mentioned earlier. If I read you correctly, i…

> I look forward to the lisper UI toolkit

I might not be able to show you such a toolkit, but I can certainly show you an operating system that allows you to write a database driver whose behavior is not affected by the user moving the mouse.

> it doesn't matter if the Oracle code is breaking the rules set out by the MS documentation

Of course it matters. I just couldn't imagine what rule there could possibly be that is both 1) broken by a database driver and 2) reasonable, that could possibly result in said driver displaying the behavior in question. (I can imagine such a rule now because to3m pointed out a reasonable possibility in another branch of this thread.)

> how preemptively dismissive you've been about Win32 while showing something of a lack of knowledge on how it works

I freely confess to being (at least potentially) prejudiced against Microsoft's technology by my anger at the fact that they reached market dominance by breaking the law. As a result of that prejudice, I have maintained a carefully cultivated ignorance of all things Microsoft -- until recently. In the past weeks I have found myself in a position where I had to do some Windows development for the first time in my career. So I am far from an expert, but I do now speak from firsthand experience when I say that, in my humble opinion, Windows is every bit the horrible monstrosity on the inside as it has always appeared to me to be on the outside. And, BTW, my opinion is shared by colleagues who know a lot more about it than I do. So yes, my opinion on this is not as well informed as it might or should be, but I have not reached in a total vacuum either.

Re: If you move your mouse continually the query may not fail. Do not stop moving

#163
post #104

Earlier quoted context omitted.

As much as I make fun of java developers for over complicated solutions, I've never quite seen anything as over-engineered and byzantine as COM. I remember at my last job we had legacy COM objects that inherited from about 5-7 different templated objects, and that was... normal. COM is the worst. I actually like windows as a user, but I'm amazed that it won as much developer mindshare as it did considering how much t…

Similar to COM, are (beside OLE, DCOM, ActiveX) Gnome's "Bonobo" (component model) [1], KDE's KParts, Mozilla's XPCOM and CORBA. Apple choose KHTML over Gecko for it's Webkit fork [2] because of the various cons of such component models. [1] Bonobo is officially deprecated: http://en.wikipedia.org/wiki/Bonobo_(component_model) [2] http://en.wikipedia.org/wiki/XPCOM

COM made several promises, and had it delivered on those promises, the world would be a better place. I can understand why projects tried to copy COM, only to regret it later.

As noted, GNOME deprecated Bonobo even though the GNOME name was meant to emphasize the CORBA/Bonobo aspect of things (Gnu Object Manipulation Environment). Mozilla spent a lot of effort removing gratuitous use of XPCOM ( https://wiki.mozilla.org/Gecko:DeCOMtamination ).

Re: If you move your mouse continually the query may not fail. Do not stop moving

#164
post #95

Earlier quoted context omitted.

The rule of thumb as I always heard it is that a window is "owned" by the thread that created it. You can send and post messages from a different thread, but do much else and you're asking for trouble. (And Send instead of Post is often problematic since it will block until the target thread processes it.) Draining the message queue from a thread that doesn't own it makes absolutely no sense to me ... Does that actua…

COM hates MTA threading, most of the Office object model actually insists on STA single-threads sitting in the main UI thread to even work (i.e. you cannot use BackgroundWorker() )! Some guy @ MS even released this byzantine code to deal with the situation ( http://blogs.msdn.com/b/andreww/archive/2008/11/19/implement... ) which unfortunately doesn't work. It's completely nuts how bad the object model is.

If you're calling an object living in STA, you should do it from the same thread or marshall the pointer before using it from a different thread. In the latter case the STA's thread needs to run message loop to process calls to the object. If the thread is showing a modal dialog or blocked doing a lengthy operation it doesn't happen. As you can see there is nothing wrong with the object model itself, it just allows to call an object that was designed to be single-threaded from the threads other than its "home" thread.

Re: If you move your mouse continually the query may not fail. Do not stop moving

#165

Whenever I am waiting for something to happen, I tend to move my mouse pointer around in circles on the screen - this always caught peoples attention and I've been asked plenty of times over the years if there was a reason for it. I always joked that it helped make things go faster by making the computer know I was still there and waiting - I guess I wasn't lying.

If I see a wall of text, I highlight it as I read through it. People think that's really odd too!

I do that all the time, even for small amounts of text, but only when using a mouse and not, say, a touchpad. I know other people who do it too.

Re: If you move your mouse continually the query may not fail. Do not stop moving

#166
post #82

Earlier quoted context omitted.

In your experience, is OSX or Linux graphical software any better? Genuinely curious. I feel like interface freezes happen on all major platforms, and always assumed it had more to do with the applications than with the platforms. I mean, writing interfaces that never block is a lot more work. But I don't have a lot of cross-platform experience to know if some platforms make it easier than others.

Yes, it has more to do with being able to usually get away with methods that really belong in the trash. My "first love" in OS's is AmigaOS, and while the OS is very dated in many ways (no memory protection, no SMP support), one of the things it really got right was to encourage extremely extensive multithreading. On Amiga's it was a necessity if you wanted to have full multitasking, as the machines were slow enough…

frankly, it would have done PC's a world of good too

Ah, the MS OS/2 2.0 fiasco. I wrote before about http://www.groklaw.net/pdf/iowa/www.iowaconsumercase.org/011... and how it ignores the limitations of the 32-bit Windows extenders, including the lack of preemptive multitasking.

Re: If you move your mouse continually the query may not fail. Do not stop moving

#167
post #165

Earlier quoted context omitted.

If I see a wall of text, I highlight it as I read through it. People think that's really odd too!

I do that all the time, even for small amounts of text, but only when using a mouse and not, say, a touchpad. I know other people who do it too.

Same here. I've always told myself that it helps my eye keep the position in the text. (Especially helpful I'm distracted and turn away from the screen.) But if I really belived that, I'd be doing it consciously, whereas I becoming aware that I'm doing it usually makes me stop...

P.S. I'm also slightly(?) OCDish in preferring selections that are integer fractions of the paragrah length. E.g. in a paragraph of 6.3 lines I'll tend to select 2.1 lines at a time (not _that_ precisely of course).

Re: If you move your mouse continually the query may not fail. Do not stop moving

#168
post #165

Earlier quoted context omitted.

If I see a wall of text, I highlight it as I read through it. People think that's really odd too!

I do that all the time, even for small amounts of text, but only when using a mouse and not, say, a touchpad. I know other people who do it too.

[deleted]
Post reply on HN