Click here to Skip to main content
15,903,201 members
Home / Discussions / C#
   

C#

 
GeneralRe: User Feedback while main thread is busy Pin
Mycroft Holmes25-Nov-09 13:31
professionalMycroft Holmes25-Nov-09 13:31 
GeneralRe: User Feedback while main thread is busy Pin
Luc Pattyn25-Nov-09 14:16
sitebuilderLuc Pattyn25-Nov-09 14:16 
GeneralRe: User Feedback while main thread is busy Pin
Mycroft Holmes25-Nov-09 14:30
professionalMycroft Holmes25-Nov-09 14:30 
GeneralRe: User Feedback while main thread is busy Pin
Luc Pattyn25-Nov-09 14:45
sitebuilderLuc Pattyn25-Nov-09 14:45 
GeneralRe: User Feedback while main thread is busy Pin
Mycroft Holmes25-Nov-09 14:55
professionalMycroft Holmes25-Nov-09 14:55 
GeneralRe: User Feedback while main thread is busy {modified} Pin
Luc Pattyn25-Nov-09 15:02
sitebuilderLuc Pattyn25-Nov-09 15:02 
GeneralRe: User Feedback while main thread is busy {modified} Pin
N a v a n e e t h25-Nov-09 16:32
N a v a n e e t h25-Nov-09 16:32 
GeneralRe: User Feedback while main thread is busy {modified} Pin
Luc Pattyn25-Nov-09 16:50
sitebuilderLuc Pattyn25-Nov-09 16:50 
yes, you have told me that before; I did not react on it then, other than start thinking about it. So I did, and I decided not to change my ways.

Of course I do agree you can use BeginInvoke, and it has the advantage of not blocking the worker.

However it does not really fit my "canonical form", where a single method can be called from the GUI thread as well as any other thread. If I were to use BeginInvoke there, it would be a synchronous method when called from the GUI thread, and asynchronous when called from another thread, which would probably be very confusing.

The same point, in other words, is: I prefer asynchronous operations to be obvious from their name, so "Begin" or "Async" should be part of the method name, which then wouldn't be possible in my canonical form.

Another, minor, issue might be: I do not like the idea of a lot of GUI work piling up somewhere, as this (1) would consume memory nobody is aware of, and (2) will consume a lot of CPU cycles even after the worker has finished.

Of course, if the net result would be fewer thread switches (I should perform an experiment), then it would have its merits.

And finally, I just added to the article a remark about avoiding frequent progress bar updates; having them synchronous should make it easier for the programmer to notice something is going wrong in that area.

If and when I do some experiments on this, I'll let you know the results.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

I only read code that is properly indented, and rendered in a non-proportional font; hint: use PRE tags in forum messages


GeneralRe: User Feedback while main thread is busy {modified} Pin
N a v a n e e t h25-Nov-09 21:53
N a v a n e e t h25-Nov-09 21:53 
AnswerRe: User Feedback while main thread is busy Pin
DaveyM6925-Nov-09 11:03
professionalDaveyM6925-Nov-09 11:03 
AnswerRe: User Feedback while main thread is busy Pin
Shameel25-Nov-09 19:54
professionalShameel25-Nov-09 19:54 
GeneralRe: User Feedback while main thread is busy Pin
Luc Pattyn26-Nov-09 0:31
sitebuilderLuc Pattyn26-Nov-09 0:31 
GeneralRe: User Feedback while main thread is busy Pin
Shameel26-Nov-09 4:55
professionalShameel26-Nov-09 4:55 
GeneralRe: User Feedback while main thread is busy Pin
Natza Mitzi26-Nov-09 8:13
Natza Mitzi26-Nov-09 8:13 
GeneralRe: User Feedback while main thread is busy Pin
Luc Pattyn26-Nov-09 8:24
sitebuilderLuc Pattyn26-Nov-09 8:24 
AnswerRe: User Feedback while main thread is busy Pin
User 260419327-Nov-09 7:08
User 260419327-Nov-09 7:08 
Questionquestion related to homework Pin
netJP12L25-Nov-09 9:45
netJP12L25-Nov-09 9:45 
AnswerRe: question related to homework Pin
PIEBALDconsult25-Nov-09 12:13
mvePIEBALDconsult25-Nov-09 12:13 
Question[Message Deleted] Pin
Slavenko8225-Nov-09 8:21
Slavenko8225-Nov-09 8:21 
AnswerRe: Query in DataSet/DataGridView Pin
I Believe In GOD25-Nov-09 9:06
I Believe In GOD25-Nov-09 9:06 
QuestionComparing Two PictureBox Pin
gamer112725-Nov-09 7:50
gamer112725-Nov-09 7:50 
AnswerRe: Comparing Two PictureBox Pin
Shameel25-Nov-09 8:07
professionalShameel25-Nov-09 8:07 
GeneralRe: Comparing Two PictureBox Pin
gamer112725-Nov-09 8:15
gamer112725-Nov-09 8:15 
AnswerRe: Comparing Two PictureBox Pin
OriginalGriff25-Nov-09 8:14
mveOriginalGriff25-Nov-09 8:14 
GeneralRe: Comparing Two PictureBox Pin
gamer112725-Nov-09 8:50
gamer112725-Nov-09 8:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.