Skip to content
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

Implement async lock support #150

Open
squili opened this issue Jun 24, 2021 · 6 comments
Open

Implement async lock support #150

squili opened this issue Jun 24, 2021 · 6 comments
Labels
enhancement New feature or request help wanted Extra attention is needed p-low Low priority issue

Comments

@squili
Copy link

squili commented Jun 24, 2021

In issue #86 you mentioned that v4 wouldn't use locks at all. I'm a bit confused on this, this it seems there's still R/W locks being used in the code for the functions. Are locks still being used? If so, would it be possible to add support for asynchronous locks?

@xacrimon
Copy link
Owner

xacrimon commented Jun 24, 2021

v4 wasn't supposed to use locks. But it had to be turned into a maintenance release based on v3 to fix some API warts since RL has kept be busy from finishing my rework of it.

@likeabbas
Copy link

Do you have any documentation as to how the next version of DashMap will be lock free? Will it be based on CTries?

@vicky5124
Copy link
Contributor

Do you have any documentation as to how the next version of DashMap will be lock free? Will it be based on CTries?

The original idea was to use https://github.com/xacrimon/flize ; but it looks like that's not going to happen now, as the repo is archived.

@exadyne
Copy link

exadyne commented Sep 15, 2021

The original idea was to use https://github.com/xacrimon/flize ; but it looks like that's not going to happen now, as the repo is archived.

It looks like it's no longer archived and it had some changes a few weeks ago. @xacrimon, would you be able to elucidate the development on the lockless version of dashmap? This is a feature I am very much looking forward to.

@xacrimon
Copy link
Owner

@exadyne @vicky5124 Heyo, yeah I recently prepped flize a bit. I still want to make a lockless dashmap but the work required is enourmous and I am someone with a very packed schedule.

So the status is that I have planned it but I cannot promise any dates whatsoever. I don’t do this for a living so it’s second priority at best in my life.

@xacrimon xacrimon changed the title Async locks on v4 Implement async lock support Feb 6, 2022
@xacrimon
Copy link
Owner

xacrimon commented Feb 6, 2022

Renamed the issue as v5 is out. I will keep this open but in the meantime, try_* functionality has been added to master and will be in a v5 point release today. This isn't a solution but may serve a temp fix. In general though, I suggest not keeping refs across await points and sync locks are also fine to use in async as per tokio docs.

@xacrimon xacrimon added enhancement New feature or request p-low Low priority issue help wanted Extra attention is needed labels Feb 6, 2022
luckysori added a commit to get10101/itchysats that referenced this issue Sep 23, 2022
The `chashmap` dependency has lead to dependabot alerting[1] about a
vulnerability in a transitive dependency. Looking at `chashmap`'s
repository it looks to me like it's not very well maintained.

On the other hand, `dashmap` looks great and should be a good
replacement for `chashmap` and `chashmap-async`. Even though `dashmap`
does not yet support async locks[2], the maintainer states that
synchronous locks "are also fine to use in async as per tokio
docs"[3].

[1]: https://github.com/itchysats/itchysats/security/dependabot/35.
[2]: xacrimon/dashmap#150.
[3]: xacrimon/dashmap#150 (comment).
bors bot added a commit to get10101/itchysats that referenced this issue Sep 23, 2022
3003: Replace `chashmap` with `dashmap` r=luckysori a=luckysori

The `chashmap` dependency has lead to dependabot alerting<sup>[1]</sup> about a vulnerability in a transitive dependency. Looking at `chashmap`'s repository it looks to me like it's not very well maintained.

On the other hand, `dashmap` looks great and should be a good replacement for `chashmap` and `chashmap-async`. Even though `dashmap` does not yet support async locks<sup>[2]</sup>, the maintainer states that synchronous locks "are also fine to use in async as per tokio docs"<sup>[3]</sup>.

[1]: https://github.com/itchysats/itchysats/security/dependabot/35.
[2]: xacrimon/dashmap#150.
[3]: xacrimon/dashmap#150 (comment).

---

Fixes https://github.com/itchysats/itchysats/security/dependabot/35.

Co-authored-by: Lucas Soriano del Pino <[email protected]>
glehmann added a commit to glehmann/earthlyls that referenced this issue Jun 6, 2024
we can’t hold a reference to a dashmap item during an await

see xacrimon/dashmap#150
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed p-low Low priority issue
Projects
None yet
Development

No branches or pull requests

5 participants