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
I've been using a SynchronizedObservableCollection and came across a strange threading / race condition... it only happens on certain machines, so I'm guessing it's a speed issue or something - or I'm just misunderstanding how it's supposed to operate.
I have calls to Add and Remove happening on different threads, and I'm seeing the following:
Main thread (UI) calls Add(item) but seems to take some time to return... and during this time, if the background thread tries to call Remove(item) ... I get the InvalidOperationException("SynchronizedObservableCollection reentrancy not allowed"); which makes sense, it's inside Add when Remove is being called...
I got around this issue by adding a queue for adding and removing items, but am not sure if there would be better way to handle this? I tried locking around the Add / Remove calls, but then I just found that the call to Add that takes a long time just never returns... so am confused by what's happening...
Is there a different way of handling the calls from multiple threads?
I've not tried to make a simple test project to reproduce it, but thought I'd let you know in case it was something obvious...
Thanks again,
Joseph
The text was updated successfully, but these errors were encountered:
Hi and thanks for your great open source project!
I've been using a SynchronizedObservableCollection and came across a strange threading / race condition... it only happens on certain machines, so I'm guessing it's a speed issue or something - or I'm just misunderstanding how it's supposed to operate.
I have calls to Add and Remove happening on different threads, and I'm seeing the following:
Main thread (UI) calls Add(item) but seems to take some time to return... and during this time, if the background thread tries to call Remove(item) ... I get the InvalidOperationException("SynchronizedObservableCollection reentrancy not allowed"); which makes sense, it's inside Add when Remove is being called...
I got around this issue by adding a queue for adding and removing items, but am not sure if there would be better way to handle this? I tried locking around the Add / Remove calls, but then I just found that the call to Add that takes a long time just never returns... so am confused by what's happening...
Is there a different way of handling the calls from multiple threads?
I've not tried to make a simple test project to reproduce it, but thought I'd let you know in case it was something obvious...
Thanks again,
Joseph
The text was updated successfully, but these errors were encountered: