Control.Invoke and performance

  • Thread starter Thread starter Magne Ryholt
  • Start date Start date
M

Magne Ryholt

Ref another post in this group "Improve Sync thread / Form".
Also ref VS2003 help:
"ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dnforms/html/winforms0611200
2.htm", stating:
"...As it turned out, I had just gotten lucky (or unlucky, depending on how
you characterize such things). Microsoft Windows® XP was providing me with a
very robust implementation of the underlying windowing system on which
Windows Forms is built. So robust, in fact, that it gracefully handled my
violation of the prime directive of Windows programming-Though shalt not
operate on a window from other than its creating thread. Unfortunately
there's no guarantee that other, less robust implementations of Windows
would be equally graceful given my bad manners..."

Does this mean that executing the delegate directly (i.e. from the worker
thread) is safe on XP ?
What about future OS's ?
 
Magne Ryholt said:
Ref another post in this group "Improve Sync thread / Form".
Also ref VS2003 help:
"ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/dnforms/html/winforms0611200
2.htm", stating:
"...As it turned out, I had just gotten lucky (or unlucky, depending on how
you characterize such things). Microsoft Windows® XP was providing me with a
very robust implementation of the underlying windowing system on which
Windows Forms is built. So robust, in fact, that it gracefully handled my
violation of the prime directive of Windows programming-Though shalt not
operate on a window from other than its creating thread. Unfortunately
there's no guarantee that other, less robust implementations of Windows
would be equally graceful given my bad manners..."

Does this mean that executing the delegate directly (i.e. from the worker
thread) is safe on XP ?
What about future OS's ?

No, it means that *some* things *may* be okay *if* you're on XP *and*
you're lucky.

In threading strategies, there are any number of things which will work
fine for quite a lot of the time, and the problem may not show up when
developing on a particular system. That doesn't mean they will *always*
work on that particular system, and it certainly doesn't mean that
they'll always work in general.

In short, that article is in no way saying it's okay to avoid using
Control.Invoke just because you know your app is running on XP.
 
Back
Top