You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is more of a question than anything. We have noticed occasions where our message handlers would be executing on the UI thread even though we always post messages using the PublishOnBackgroundThread method to publish these messages. Upon reading into the issue and looking at the Caliburn.Micro source, I suspect this might be due to the usage of Task.Factory.StartNew in the PublishOnBackgroundThread method. Would Task.Run be more appropriate here to ensure that we are always using TaskScheduler.Default?
As we support Silverlight 5 and .NET 4.0 Task.Run is not an option.
If I remember correctly it is only a wrapper around Task.Factory.StartNew, so it should be enough to set the right parameters. Suggestions?
This is more of a question than anything. We have noticed occasions where our message handlers would be executing on the UI thread even though we always post messages using the PublishOnBackgroundThread method to publish these messages. Upon reading into the issue and looking at the Caliburn.Micro source, I suspect this might be due to the usage of Task.Factory.StartNew in the PublishOnBackgroundThread method. Would Task.Run be more appropriate here to ensure that we are always using TaskScheduler.Default?
http://richnewman.wordpress.com/2012/11/21/why-starting-a-new-task-in-the-task-parallel-library-tpl-doesnt-always-start-a-new-thread/
The text was updated successfully, but these errors were encountered: