Rethreading a single threaded app.

This was solely my biggest challenge this year.

Between BackGroundWorker, SynchronizationContext, Thread.Start(), Begin and EndInvoke. These things aren’t magic and can’t save you from a single threaded application that makes many lots of calls to background synchronous methods that update the UI thread.

No matter what I did , I kept getting the STA thread error until I traced the culprit that was secretly updating the view model that was never thought of to be called from another thread.

I had to reach out a little and tag one of my former co-workers.

Sergey Barskiy, his advice which is very solid led me to really want to upgrade my application to 4.5 which just isn’t doable right now.

His advice in a blog (If you have 4.5) this is a valid approach and suggested:
(He is also the best real-world developer I know in or out of Microsoft).

Due to the lack thereof for using 4.5 I ended up following the rabbit hole into the Reactive Extensions.

Bart J.F. De Smet is brilliant.

This is a great watch for all developers and seems to be a good fit for my current threading blues. Using the Push mechanism rather than Pull.

Finally to finish a video by one of my friends here in Atlanta:

JIm Wooley’s



Now for the fun:   Here is the best information I could find on threading and the ObserveOn SubscribeOn

Categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: