PC Review


Reply
Thread Tools Rate Thread

Thread and message pump

 
 
Oriane
Guest
Posts: n/a
 
      22nd Jan 2009
Hi,

If I run a classical Windows Form .Net application, with several UI
controls/windows, I guess that (unless I explicitely create new threads)
every UI objects will have the same message pump (since they all have been
created by the same thread). Correct ?

My point is that when we speak about the "UI thread", I don't know if we
speak about the thread which owns the message pump or about the thread which
updates the UI. I want to be sure that this thread does both.

Best regards

 
Reply With Quote
 
 
 
 
miher
Guest
Posts: n/a
 
      22nd Jan 2009
Hi,

As i know control members can be accessed only from the thread that created
it(otherwise You have to Invoke), so at the end the "thread which updates
the UI" is the same as the thread which owns the control.

Hope You find this useful.
-Zsolt

"Oriane" <(E-Mail Removed)> az alábbiakat írta a következo üzenetben
news:67602C1C-B652-49A8-BAD0-(E-Mail Removed)...
> Hi,
>
> If I run a classical Windows Form .Net application, with several UI
> controls/windows, I guess that (unless I explicitely create new threads)
> every UI objects will have the same message pump (since they all have been
> created by the same thread). Correct ?
>
> My point is that when we speak about the "UI thread", I don't know if we
> speak about the thread which owns the message pump or about the thread
> which
> updates the UI. I want to be sure that this thread does both.
>
> Best regards
>

 
Reply With Quote
 
 
 
 
Linda Liu[MSFT]
Guest
Posts: n/a
 
      23rd Jan 2009
Hi Oriane,

Yes, every UI object will have the same message pump.

Message pump is also called message queue. The system automatically creates
a message queue for each thread in an application.

If the thread creates one or more windows, a message loop must be provided;
this message loop retrieves messages from the thread's message queue and
dispatches them to the appropriate window procedures.

In WinForm applications, we call Application.Run method to run a standard
application message loop on the current thread.

> when we speak about the "UI thread", I don't know if we speak about the

thread which owns the message pump or about the thread which
updates the UI.

The "UI thread" refers to the thread that creates forms and controls on the
forms and that updates the UI.

Hope I make things clear.
If you have any question, please feel free to let me know.

Sincerely,
Linda Liu
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(E-Mail Removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to pump messages on a worker thread Mike23 Microsoft ASP .NET 10 11th Nov 2009 04:51 PM
How to pump messages on a worker thread Mike23 Microsoft C# .NET 10 11th Nov 2009 04:51 PM
Approach to Implement a Thread Pump? DC Microsoft C# .NET 5 17th Jan 2007 04:00 PM
Create a thread with a Windows Message pump Sagaert Johan Microsoft C# .NET 0 24th Mar 2005 06:22 PM
Message Pump/Thread quiting trouble =?Utf-8?B?Zmh1bnRlcg==?= Microsoft Dot NET Compact Framework 2 8th Apr 2004 01:57 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:10 AM.