Assuming we are talking about a WinForms application...
The underlying architecture of a Windows application (which should include a
WinForms application) is that it is "event-driven".
Everything the operating system wants to tell you about comes to you in the
form of a Windows message. This includes mouse movement, clicks, etc. They
arrive at your application in the form of a "windows message".
Your application, under the covers, is executing a loop, retrieving one
message at a time from the "message queue", and "dispatching" the message to
a processing function (a window proc).
Until the processing function returns, the next message cannot be processed.
This is why one button click must be processed before the next one. Windows
does not "jump in" to your application asynchronously to execute your event
handler. It just "seems" like that is what it is doing.
When you have an event that requires a substantial amount of processing, the
whole message loop grinds to a halt and the application becomes
non-responsive. For example, if your application was doing a large sort it
would not respond to button clicks until the sort completes (unless a
separate *thread* is explicitly started to perform the sort).
Ultimately one problem with most windows abstraction frameworks is you still
need to understand what is going on underneath the covers in order to use
the framework effectively.
Hope this helps.
"Coder" <co*****@yahoo.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
So there are various ways to enter a thread. Example:
- Button click
- Event from delegate call back.
- etc...
In fact, I suppose all entry points are from some form of an event.
Questions:
- When I click a button, does it it get blocked till the last button
click is done? If so why?
- What about other events that I could get such as from MSMQ letting me
know a message has arrived? Or what about if I set up a call back
delegate for a web service to call me back on?
- Do these events call into my thread even if my thread is busy? If
not, how can I get them to call into my thread if my thread is busy?
Thanks!
Coder :)