views:

150

answers:

1

I'm in the process of writing a asynchronous-operation manager somewhat similar to the BackgroundWorker class. I know that the BackgroundWorker does some internal voodoo (using the AsyncOperation class, from what I've read) to fire its events on the thread that created the BackgroundWorker, which is typically a UI thread.

My question is: what voodoo is necessary for events to get fired on a specific thread like the BackgroundWorker does?

+4  A: 

It is using SynchronizationContext Class

Giorgi
+1 A recommended read for any C# programmer.
Aviad P.
A terse answer, but linked to a verbose article. +1 and thanks. :)
Adam Maras