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
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
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
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
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
> 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
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
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
> 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
> 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
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
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
> 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
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
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
> 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
:|
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
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
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,
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.
#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
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
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
> 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/
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
>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,
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
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
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
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
30 matches
Mail list logo