News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

1000 thread polling loop demo

Started by hutch--, August 26, 2005, 03:30:37 AM

Previous topic - Next topic

QvasiModo

I think I'm gonna be sick if I see yet another "polling vs waiting" discussion here... :eek

But there's a lesson we can all learn from this: you can continue stupid arguments forever when you're running your own forum. :lol

hutch--

QvasiModo,

There has always been a way to determine if something is true or false, put it to the test. That is what the posting is about with the working source code atached to it. It may not fit your personal theory and it may not prop up other people who have a vested interest in trying to win an argument where tey are wrong but if your theory does not pass the same test as the atached example, then your theory is a failure.

Now to help you fix your opinion, read up on Von Neuman to get the fundamental architecture of all current hardware and undestand why there is no-where to hide from periodically polling for events. Windows is basically an asynchronous operating system and the much flaunted Wait APIs are an appendage at best to try and cover up a deficiency in OS design where earlier version were hopeless at synchronous tasks..

They seem to work OK if you can get them to perform something useful but they are nothing like comprehensive and you cannot do anyting like the same range of tasks as you can with conventional polling. Try writing a Windos message loop with Wait APIs or consruct a WndProc which polls anyting the OS points at it

> I think I'm gonna be sick if I see yet another "polling vs waiting" discussion here...

Trust me on this much, so am I but this issue has been spat in my face at random intervals for years so I will keep pointing out the technical mistakes of those who are foolish enough to think that they can run an OS that does not poll for information. A fundamental programming technique does not suddenly become useless because a few people stumble onto a few cluncky high level wait state API and actually learn how to partially use them.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Randall Hyde

Quote from: striker on August 28, 2005, 02:39:35 AM

Rgs, Striker.

ps - I dont think Randall had his happy flakes this morning.

Oh, you might try reading this:

http://groups.google.com/group/alt.lang.asm/browse_frm/thread/d71d7345d622c4c1/6ae0dade5dba95c6?hl=en#6ae0dade5dba95c6

or maybe

http://groups.google.com/group/alt.lang.asm/browse_frm/thread/adc4c422f4064f7a/d5d98477647c8d81?hl=en#d5d98477647c8d81

or even

http://groups.google.com/group/alt.lang.asm/browse_frm/thread/43b29b1a62e6a800/df2e8267b60e5863?hl=en#df2e8267b60e5863

Hutch has been spamming ALA with this polling nonsense, even when it's been shot down time and time again. And in the process he is attacking some decent people there (myself included, Donkey too).

The bottom line is that polling is inappropriate for the application Hutch has posted. He keeps trying to justify it on the basis of how few cycles it consumes in the polling loop. You can make all the arguments you want about how you can do other things in the polling loop, but the code he posted does no such *extra* things. WaitForSingleObject is the right approach. I hate to insult people around here, but if you think otherwise, you really need to pick up a text on concurrent programming and start reading...
Cheers,
Randy Hyde



QvasiModo

#18
LOL, I particularly liked this bit of technical argument: :bdg

[Refere to post below, this forum does not allow arguments from other places to be continued here]

PBrennick

QvasiModo,
If you do not believe GetMessage is a polling loop, you need to better understand the workings of the messaging system.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

roticv

Paul,

QvasiModo is saying that Hutch thinks that "GetMessage has a polling loop" and not that he does not believe GetMessage is a polling loop.

Rest:

Ahhhhhhhh now things get more interesting, but I shall not waste my time on ALA to fight over mindless things. I would rather spend my time learning new algorithms than being stuck arguing over stupid things.

Regards,
Victor

PBrennick

Neither will I be found posting in ALA.  The rest of your post does not make sense to me.  I know what QvasiModo is saying and he is not correct.  If there is no loop in the messaging system, the user would only be able to get one message.  This has nothing to do with the ongoing argument, just about the messaging system.

Paul
The GeneSys Project is available from:
The Repository or My crappy website

QvasiModo

#22
Quote from: PBrennick on August 31, 2005, 06:33:08 PM
Neither will I be found posting in ALA.  The rest of your post does not make sense to me.  I know what QvasiModo is saying and he is not correct.  If there is no loop in the messaging system, the user would only be able to get one message.  This has nothing to do with the ongoing argument, just about the messaging system.

Paul


You are welcome to make technical comments but continuing an argument that is ocurring in ALA is not allowed in this forum. Please keep your coments technical here.

hutch--

QvasiModo,

Understand tis much, this forum does not allow arguments started in other places to be continued here. If you want to join the debate  in ALA, feel free to do so but keep it out of here.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

QvasiModo

@ hutch--:

I don't want to continue the ALA argument, I already said I'm sick of those, it's too biased with personal insults anyway.
I was clarifying my previous post because Paul misunderstood my words about the messaging system. (I do understand why you edited the other post though - since the message was for you I'm fine with that as long as you read it yourself).

@ PBrenner:

Back to the technical part, in my post I said that GetMessage is called in a loop, but is not implemented using a polling loop - two different concepts. (Please correct me if I'm wrong).

hutch--

There is noting contentious in saying that GetMessage() is not a loop, it is well known that it is a data retrieval function that loads any pending mesage in the system mesage que into a MSG structure. The GetMessageAPI is normally used in a loop which polls the return value of GetMessage() to test if its zero.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

PBrennick

Qvasimodo,
I do not know who @ PBrenner is but if you are talking to me then, yes, I am willing to stand corrected on that one.  The loop must exist though or the messaging system is pointless.  That is my valid contribution to this thread.  Sorry I misunderstood you, though I cannot say for sure that I did as it no longer exists for me to double check but I will give you the benefit of the doubt.

Stay well,
Paul
The GeneSys Project is available from:
The Repository or My crappy website

Vortex

Quote from: roticv on August 31, 2005, 06:19:01 PM
Ahhhhhhhh now things get more interesting, but I shall not waste my time on ALA to fight over mindless things. I would rather spend my time learning new algorithms than being stuck arguing over stupid things.

Very nice :U :U :U

QvasiModo

Quote from: PBrennick on September 01, 2005, 12:43:49 AM
Qvasimodo,
I do not know who @ PBrenner is but if you are talking to me then...

Not intentional, sorry for the typo. :(

Quote...yes, I am willing to stand corrected on that one.  The loop must exist though or the messaging system is pointless.  That is my valid contribution to this thread.  Sorry I misunderstood you, though I cannot say for sure that I did as it no longer exists for me to double check but I will give you the benefit of the doubt.

Surely you don't think I didn't know what a message loop is... I've been around long enough to learn that much. :)

I think nobody had their happy flakes around here... we should all remember this is just about a bunch of letters in a computer screen!  :lol

PBrennick

I haven't been happy for 6 years and when this disease finally takes my life I will still be unhappy.  But that has nothing to do with my years of programming knowledge and my insight into how things function.

Paul
The GeneSys Project is available from:
The Repository or My crappy website