Use of SynchronizationContext question

S

schaf

Hi All!
I have a little question about the SynchronizationContext. i'm using
it for UI synchronization.
Is it better the synchronize to the main thread (UI thread) as soon as
the event (thread pool thread) is handled or just for the functions,
which really access the UI?

In my application I handle events (thread pool threads) in a common
library (lib1). lib1 will fire an event for all interested objects
(which are registered as event listnerer in lib1). Some of these
objects will access the UI to do some wotk, others will just doing
business logic.

So now I can synchronize to the main thread in lib1, or just in the
corresponding objects, which access the UI. What is the pro and contra
of these two possibilities? what is recommended?

Thanks and Regards
Marcel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top