At 10:46 AM 9/14/2003 +0400, Dmitry Shaporenkov wrote (in part)
>----- Original Message -----
>From: "J. Merrill" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Saturday, September 13, 2003 8:05 PM
>Subject: Re: [ADVANCED-DOTNET] Object identities, marshaling issues and
>interoperability
>
>> Avoiding multiple threads sometimes makes life simpler.
>>
>> J. Merrill / Analytical Software Corp
>
>    You are right, of course. However, besides performance there is a reason
>for using multiple threads, and this
>    reason is responsiveness of the application. When my application runs a
>time-consuming operation,
>    it would be nice for a user to see a progress indicator showing how far
>the operation has gone. This assumes that the
>    operation itself is performed in a separate thread, so that the UI
>thread can process events from the user and the operating
>    system.

You can get the equivalent of "background processing" using the Application.Idle event 
handler.  You can choose to do as much or as little processing in each "step" (each 
call to your Idle handler) as you want.  If you don't do much processing at each call, 
the application will be very responsive.

One other point -- if you handle the Idle event and do only a little bit of processing 
each time, don't update the progress indicator at each call.  Only do so if at least 
1/2 second (or a full second) has gone by since your last progress indicator update -- 
the user doesn't gain much from seeing the indicator go up super-fast.

Good luck.



J. Merrill / Analytical Software Corp

===================================
This list is hosted by DevelopMentorŪ  http://www.develop.com
NEW! ASP.NET courses you may be interested in:

2 Days of ASP.NET, 29 Sept 2003, in Redmond
http://www.develop.com/courses/2daspdotnet

Guerrilla ASP.NET, 13 Oct 2003, in Boston
http://www.develop.com/courses/gaspdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to