<ia************@googlemail.comwrote:
Hello, this came up a few days ago, well similar. I suggestedI think these articles are informative and useful food for thought.
SynchronizationContext briefly, I've found a blog post which explains
the ThreadBarrier pattern and may be of use.
http://blog.quantumbitdesigns.com/20...threadbarrier/
and also
http://blog.quantumbitdesigns.com/20...ier-revisited/
However, they don't seem to really be applicable here, and I definitely
disagree with the implication that a) using Invoke() is "polluting the UI
thread" and especially b) that the proposed alternative, using the
SynchronizationContext class, avoids "polluting the UI thread". If
there's a pollution problem (and I don't feel that there is), the
SynchronizationContext approach has exactly the same problem that
Control.Invoke() does (seeing as they both wind up using the same
mechanisms).
In this particular message thread, there is a specific need to execute the
code on the GUI thread. There's no way around that. The simplest, most
straightforward way to do that is to simply call Invoke() with an
anonymous method that contains the code that needs to be executed.
It's good for people to know that SynchronizationContext exists and how to
use it. But in reality, Control.Invoke() (or Control.BeginInvoke()) is
sufficient and perfectly appropriate for most needs.
Peter, Google groups is working in Opera again :DYay! :) Still, you might eventually find that using a real newsreader is
better. :)
Pete