473,770 Members | 4,029 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need to understand message queue, loop, threads. Thanks

2 New Member
Hi everyone,

I am a newbie to GUI application, and I need help in understanding some concepts:

For a Windows-based GUI application, the system maintains a single system message queue. Mouse events etc. are converted into messages and are put in the system message queue by device drivers. The system removes the messages from the system message queue, and posts them to the message queue of the thread that created the destination window...

Now, Is the thread mentioned in the last sentence what people call UI thread? I know this thread removes the messages from its queue and directs the system to call the window procedure. Is the same thread used to call the window procedure or is another system thread used (I tend to think the same thread is used)? In .NET is the window procedure implemented by delegates/event handlers?

Thanks
Jan 29 '07 #1
2 1893
kenobewan
4,871 Recognized Expert Specialist
Asp.net threading is not the same as the window procedure. Threading in asp.net is defined by the framework. Here is an article that may help:
Use Threads and Build Asynchronous Handlers in Your Server-Side Web Code
Jan 30 '07 #2
hc0605
2 New Member
.NET Form application should be based on the win32, and the concepts of message loop, window procedure should be similar.

My understanding is that for a simple single-threaded .Net Form application, Application.Run (myForm) begins running a standard application message loop on the current thread. All the event handlers of the controls on 'myForm' are executed on this thread sequentially. However, I have a single-threaded Form application with a button on 'myForm'. If I click on the button for a couple of times, the code in the button click handler seems not executed sequentially. This is what confuse me.
Jan 30 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
1526
by: Richard Townsend | last post by:
I've been experimenting putting a reference to a function into a Queue object and was wondering what actually gets put in the Queue - is it the function's code object? If I read from the Queue in a different module, it appears that I don't need to import the module that defines the function - or any module that it uses - is this generally true, or are there some conditions to be aware of? The scenario I'm working on has child threads...
3
7406
by: Brian Keating EI9FXB | last post by:
Hello again, I've already placed a few posts on this topic. This time i've a simple application that exhibits my problem, I've placed sample solution 8k on my website should anyone be interested in having a look. http://briankeating.net/transfer/test.zip To recap the problem I expected (and found). I've a main GUI thead (main form), this GUI thread has an UpdateTextBox function that appends a string in a textbox and It also has a button...
8
16347
by: Brian Keating EI9FXB | last post by:
Would I be correct in saying that the only way to get a user message into a Windows form would be to use P/Invoke with Message? Of is there some part of the .NET API that I am totally un aware of? Thanks for any help Brian
5
3106
by: Sinan Nalkaya | last post by:
hello, i need a function like that, wait 5 seconds: (during wait) do the function but function waits for keyboard input so if you dont enter any it waits forever. i tried time.sleep() but when i used time.sleep in while, the function in while never executed. then i found something about Timer but couldnt realize any algorithm in my mind.
10
1691
by: HK | last post by:
With VB.NET 2005, and a Windows Form, running on a dual CPU box, I need to take a recordset (e.g. 100,000 records) and spawn a thread to handle an internet XML transaction routine for each of the records. This is a nice use of threading because those internet requests are going against 3rd party servers that often have 1 second latency problems and so handling them with multiple threads is the fastest way to get through all the records in...
2
5307
by: tikcireviva | last post by:
Hi Guys, I've done a mulithread queue implementation on stl<queue>, my developement environment is on VC6 as well as FC3. Let's talks about the win32 side. The suspected memory leak is find after I've run through my unit test cases. Test Case:
2
1465
by: pbd22 | last post by:
Hi. I am getting the error: "Thread is running or terminated. It cannot restart." It is happening inside a file upload loop where a thread is created for each file (reporting bytes). After the first file is uploaded, the error is thrown at workThread.Start(). I am new to threading and would appreciate advice on how to code this so when the next file is starting to upload, the thread is restarted (reinstantiated).
10
1412
by: Craig Buchanan | last post by:
I would like to have a limited pool of objects (the objects are expensive to create) that can be enlisted to process items in a queue. Moreover, I would like to be able to have the processing (time-consuming) occur on a background thread. I have two questions: * what is a good way to block the queue loop while it waits for a free worker? * is my approach a reasonable one?
5
2031
by: bean330 | last post by:
Hey, I'm somewhat new to C# and I need a little help, please! I'm selecting a bunch of records, setting properties on a COM executable and then calling a method on that executable to run. I want to run the executable in separate threads because they can be long-running and it would be optimal for us to run a bunch simultaneously. I've got that part working - it's pretty easy in C#. What I'm having a hard time with is managing the...
0
9439
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10237
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10071
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10017
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8905
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.