Antidote-for-Tox / objcTox

No longer maintained
Mozilla Public License 2.0
38 stars 12 forks source link

Sync methods on RealmManager may lead to deadlock #51

Closed dvor closed 8 years ago

dvor commented 9 years ago

Need to investigate this.

Chuongv commented 9 years ago

So I was looking at this today. In Antidote, all the the RBQFetchedResultsControllerDelegate methods are ran on the OCTRealmManager queue. So when we call a method that does any realm work (for example in Antidote updateLastReadDate) it dispatch_sync on the same queue again which causes a deadlock. I'm not sure if we could do anything on the objcTox side of things to alleviate this.

dvor commented 9 years ago

Yeah, this doesn't look good. One option is to modify RBQ controller. Other is to wait for Realm https://github.com/realm/realm-cocoa/issues/687

bigfish24 commented 8 years ago

Just noticed this from the link to the Realm issue. While Realm is getting close to having the feature support to make RBQFRC irrelevant, I can hopefully help with RBQFRC in the mean time. The deadlock issue is expected (and listed as a limitation in the README). You should make sure that every write that triggers a notification for RBQFRC is on a background thread.

dvor commented 8 years ago

Hi @bigfish24, thanks for answering. I'll give that a try.

dvor commented 8 years ago

No longer relevant after migrating to Realm notifications.