-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deadlock when working within async threads #79
Comments
This is a known issue. It stems from the fact that you are keeping a Ref guard bound to |
I've released the mostly feature complete version |
Hello, I tried to run this example code with rust 1.51 stable toolchain 2018 edition, dashmap v4.0.2, with tokio 0.2.25/0.3.7/1.5.0, all of them run for ever ? (I'm running on linux x86-64) |
I can confirm this is still an issue when holding write locks over await points, it looks like the PR for the original v4 was closed: #81 so this issue is still open. It'd be great if there was an alternative that used rwlocks from tokio under the hood. |
Maybe |
Yeah, that makes perfect sense. Generally this isn't a problem as tokio advises using regular locks anyway for protected data even in async code but the await point problem needs to be looked into. When I have time I am looking to add a variant that uses async locks but I cannot provide a timeframe for this as I don't get paid for this work. |
Any update regarding that? |
I think "don't hold a lock across a |
|
Following code hang forever
To make it simple to explain, say there are 2 coroutines and 1 thread underlying.
The above might be the cause of the hanging issue. However, I don't think it's going to be fixed by Dashmap(no way to yield or notify tokio to reschedule), at least it's not easy.
If we're not going to fix it should we warn users not to use it with tokio in similar usecases?
The text was updated successfully, but these errors were encountered: