True....I was thinking that was implied, but not a good thought because when I started 
doing threads I didn't know this either :)

-----Original Message-----
From: Ian Griffiths [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 10, 2002 6:08 AM
To: [EMAIL PROTECTED]
Subject: Re: [DOTNET] Loading forms


Not to mention the fact that you're not allowed to do anything to a control
from a worker thread other than call Invoke, BeginInvoke, EndInvoke, or read
the InvokeRequired property.

So having retrieved your data you then have to marshal a call back onto the
UI thread (using Control.Invoke or Control.BeginInvoke) in order to update
the display.

(Mind you lots of people don't realise this and just use controls from the
worker threads.  But this is very bad.)

Dealing with timeouts and cancellation is also a real pain.  Quitting the
application cleanly can also be surprisingly hard...


--
Ian Griffiths
DevelopMentor

----- Original Message -----
From: "franklin gray" <[EMAIL PROTECTED]>


Well, the spawning of a new thread isn't that hard, just dealing with all
the little things such as showing the right cursor, dealing with the case
that if a user closes the form before the retrieval thread is done and so
on.

-----Original Message-----
From: Dan Souk [mailto:[EMAIL PROTECTED]]

How much is a lot?

-----Original Message-----
From: franklin gray

Just out of curiousity, does anybody use a different thread to retrieve
data to populate a form besides me?  I like how it doesn't bogg down the
UI thread and forms paint better, but it's a lot more work.  Just
curious.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to