Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-02 Thread J. Merrill
Inline At 07:22 AM 3/2/2004, Griffiths, Ian wrote (in part) >SendMessage only calls the target window's procedure directly if you >call it from the UI thread. The Win32 documentation says that if you >send a message from some other thread, the message will only be >processed when the UI thread ex

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-02 Thread Griffiths, Ian
SendMessage only calls the target window's procedure directly if you call it from the UI thread. The Win32 documentation says that if you send a message from some other thread, the message will only be processed when the UI thread executes message retrieval code (i.e. its message pump runs). It w

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-02 Thread J. Merrill
TECTED] On Behalf Of John Davis >>>Sent: 01 March 2004 11:48 >>>To: [EMAIL PROTECTED] >>>Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) >>> >>>Yes, Control.Invoke uses the message pump. The message pump is the queue >>>you speak o

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-01 Thread Richard Blewett
aslavskiy > Sent: 01 March 2004 19:18 > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) > > I think they both use PostMessage and Control.Invoke waits on event. > This difference is *almost* never makes a difference. > > D

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-01 Thread Dmitriy Zaslavskiy
Message- From: Moderated discussion of advanced .NET topics. [mailto:ADVANCED- [EMAIL PROTECTED] On Behalf Of John Davis Sent: 01 March 2004 11:48 To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) Yes, Control.Invoke uses the message pump. The message pump

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-01 Thread John Elliot
> Or you may want to take a look at Microsofts asynchronous application > block I've spent an hour or two sort of looking through the code for this, but haven't got too heavily involved with it. I guess the reason I didn't get to stuck into it is that I don't really want asynchronous processing. I

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-01 Thread Richard Blewett
h 2004 11:48 > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) > > Yes, Control.Invoke uses the message pump. The message pump is the queue > you speak of. I'm guessing the mechanism uses a PostMessage with a > WM_USER

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-01 Thread John Davis
1, 2004 5:34 AM Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) > > If the UI never accesses the model directly (which would require > locking > > to avoid possibly getting inconsistent data if the model is in the > process > > of being updated), but o

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-01 Thread John Elliot
> If the UI never accesses the model directly (which would require locking > to avoid possibly getting inconsistent data if the model is in the process > of being updated), but only sends requests (via BeginInvoke) to the model > thread for information, does that solve the problem? I'm not sure th

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-03-01 Thread John Elliot
> I think either you're over-analyzing this, or the problem is in fact much > bigger than MVC. :) Over-analysis: personality-flaw or occupational hazard? :) John. === This list is hosted by DevelopMentor® http://www.develop.com Some .NET courses you may be intere

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-29 Thread Shawn A. Van Ness
Hi John, I think either you're over-analyzing this, or the problem is in fact much bigger than MVC. :) Let's forget about MVC for a moment, and consider a much more common scenario: WM_PAINT. Do the View objects know how to render themselves, without asking anything of the Document? Probably no

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-29 Thread J. Merrill
If the UI never accesses the model directly (which would require locking to avoid possibly getting inconsistent data if the model is in the process of being updated), but only sends requests (via BeginInvoke) to the model thread for information, does that solve the problem? The UI thread will u

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-28 Thread John Elliot
> I'm not certain that I understand your situation completely, but I don't > see any issues that wouldn't be handled by using BeginInvoke rather than > Invoke. That will let both UI and process threads proceed without waiting > on the other. I was implying that I would use BeginInvoke, so that ea

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-28 Thread Andrew Gayter
Moderated discussion of advanced .NET topics. [mailto:ADVANCED- > [EMAIL PROTECTED] On Behalf Of J. Merrill > Sent: 27 February 2004 14:28 > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) > > I'm not certain that I understand your s

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-27 Thread J. Merrill
I'm not certain that I understand your situation completely, but I don't see any issues that wouldn't be handled by using BeginInvoke rather than Invoke. That will let both UI and process threads proceed without waiting on the other. In some cases, you might want to use the FireAndForget mechan

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-27 Thread John Elliot
> Oh, and the Tablet PC's Ink API fires some events on background threads... > Go figure, eh? Firing events from background threads for consumption in the UI is the hardest problem (for me) that I face at the moment. If I have a long running process that needs to invoke events that the UI has hoo

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-27 Thread Shawn A. Van Ness
:| Jade Burton -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Shawn A. Van Ness Sent: Tuesday, 24 February 2004 7:20 PM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) Jade, I feel yo

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-26 Thread J. Merrill
There can be no "final points" in this discussion! From a practical perspective, I most heartily disagree. Single-threading is a much simpler model to work in, and unless the language / environment makes it 100% transparent that we're not single-threaded we'll have so many bugs it simply isn't

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-26 Thread Griffiths, Ian
Jade Burton wrote: > wouldn't it be great if the UI thread wasn't tagged as STA, > but rather that it was just like any old thread? This would > mean you still have a single thread dispatching events to event > handers, but your window objects would instead be written to be 100% > threadsafe and,

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-26 Thread Jade Burton
yone :| Jade Burton -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Shawn A. Van Ness Sent: Tuesday, 24 February 2004 7:20 PM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) Jade, I feel your pain.

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-24 Thread Shawn A. Van Ness
#x27;t I create a >modal dialog from within a worker that simply blocks until the user clicks >OK, rather than using another message loop etc?) > >Or are we stuck with what I would regard as a system that requires the >programmer to write (and - ugh - think about) "non-busin

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-23 Thread Jade Burton
ocess it, show a result dialog, then exit thread".. Now that's elegant. Jade Burton -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of J. Merrill Sent: Tuesday, 24 February 2004 1:53 AM To: [EMAIL PROTECTED] Subject: Re: [ADVANC

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-23 Thread Cleve Littlefield (Murphy and Asso)
PM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) As a sidebar to the topic of threads and message pumps, am I the *only* person in the world who wishes there was greater *cohesion* and *transparency* between WinForms' and worker threads? Why, in 2004, do p

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-23 Thread Daniel Gackle
> You should not be performing any long-blocking operations on your main UI thread. Some articles on this topic that I have found helpful are: http://msdn.microsoft.com/msdnmag/issues/03/02/Multithreading/default.aspx http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/htm l/

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-23 Thread Richard Blewett
Richard Blewett DevelopMentor > -Original Message- > From: Moderated discussion of advanced .NET topics. [mailto:ADVANCED- > [EMAIL PROTECTED] On Behalf Of Thomas Tomiczek > Sent: 23 February 2004 07:17 > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Thread with messa

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-23 Thread J. Merrill
>programmer to write (and - ugh - think about) "non-business logic" plumbing >code... > >Jade Burton > >-----Original Message----- >From: Moderated discussion of advanced .NET topics. >[mailto:[EMAIL PROTECTED] Behalf Of Shawn A. Van >Ness >Sent: Saturday,

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-23 Thread Thomas Tomiczek
nced .NET topics. > [mailto:[EMAIL PROTECTED] Behalf Of > Shawn A. Van Ness > Sent: Saturday, 21 February 2004 10:48 AM > To: [EMAIL PROTECTED] > Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) > > > Call Application.Run (or even Application.DoEvents) do

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-22 Thread Jade Burton
e... Jade Burton -Original Message- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] Behalf Of Shawn A. Van Ness Sent: Saturday, 21 February 2004 10:48 AM To: [EMAIL PROTECTED] Subject: Re: [ADVANCED-DOTNET] Thread with message pump (UI thread) Call Applicati

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-21 Thread Shawn A. Van Ness
Call Application.Run (or even Application.DoEvents) do establish a message queue for your secondary thread. A better answer: You should not be performing any long-blocking operations on your main UI thread. This rule goes right up there alongside "thread that creates the window services the windo

Re: [ADVANCED-DOTNET] Thread with message pump (UI thread)

2004-02-20 Thread Mattias Sjögren
Aman, In the managed world (using C#) , how do we create a thread with a message pump as opposed to a worker thread ? You call Application.Run() from that thread. Mattias -- Mattias Sjögren [EMAIL PROTECTED] === This list is hosted by DevelopMentor® http://www