Deadlock when un-docking in DevExpress

1061
4
12-19-2019 12:04 PM
JohnDeClouet
New Contributor

I am using DevExpress DockManager. When I undock a window containing a MapView, my application deadlocks. The attached image shows the deadlocked threads. The reason for the deadlock is because on the Main Thread, HostedSurfaceElement.CreateHostedElementOnWorkerThread starts a thread to call HostedSurfaceElement.SurfaceBackgroundUiWorker and then calls this._backgroundUiCreatedEvent.WaitOne() to wait for the SurfaceBackgroundUiWorker method to complete. However, the method sets the RootVisual which ultimately causes ResourceDictionary.GetValue to be called, causing the deadlock. 

Is there a way around this?

0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor

Any chance you could share a simple application that reproduces the issue?

As a workaround you could try and enable a legacy-mode that disables the secondary UI thread (just note it could potentially have a small performance impact) :

AppContext.SetSwitch("Switch.Esri.ArcGISRuntime.DisableSecondaryUIThread", true);

Note: You'll need to use v100.7 for this switch to work (if you can't move to 100.7, at least just try it briefly just to confirm whether this is the addresses the issue, so it gives us something more to go on wrt trouble-shooting). Also this switch might or might not continue to have an effect in future releases, so providing a reproducer sample would be helpful so we can try and address any issue there might be here.

0 Kudos
ScottLehto3
Occasional Contributor

Hi,

     Are there examples of using Devex with the .NET SDK? I would love to see an example ad I am researching this now and coming up short.

 

Thanks,

Scott

0 Kudos
JohnDeClouet
New Contributor

Thank you for the response. 

Unfortunately, I am unable to reproduce this issue outside of my application. 

The issue is resolved after upgrading to v100.7 and adding the AppContext.SetSwitch("Switch.Esri.ArcGISRuntime.DisableSecondaryUIThread", true);

On a side note, we often observe issues related to unobserved Task exceptions. We stopped using some async calls due to this.

We will make an effort to provide more details to you related to these issues in the future. 

Until those issues are resolved, we hope that the switch will retain its effect.

0 Kudos
ScottLehto3
Occasional Contributor

I would love to see an example of using DevExpress Reporting with the .NET SDK. I am beginning to explore this as a reporting option.

0 Kudos