Closed wbogocki closed 2 months ago
Hi!
Yes, async methods yield when they could not immediately acquire locks, and entries held across awaits may cause deadlock if sync methods are used elsewhere. I'll update the doc to clearly state the purpose of async methods!
Got it. Thanks.
Hi. I've been scanning through the docs trying to figure out how this crate behaves around await points, specifically HashMap and IndexMap. I can see that there's an async API, which I think yields if accessing an entry would lock. Reasoning from this, it seems to me that the sync API could be made to deadlock if an entry was held across an await point. Is this the case?
I'm asking this in context of a similar situation in the
dashmap
crate which does deadlock.A clarification in the docs on this and the purpose of the async API could perhaps be useful.
Thanks :)