Skip to content

about class Ref<T> { public T Value; } #596

Answered by dadhi
vanasis asked this question in Q&A
Discussion options

You must be logged in to vote

@vanasis The Ref is the helper abstraction to allow optimistic-concurrency Swap operation on the Value.
I am using it internally in DryIoc in concatenation with the immutable collections like ImHashMap to enable thread-safe set of the new value of the map without locking (this is the whole purpose of the optimistic concurrency). You may look through the Ref.Swap or just a .Swap method usages in Container.cs for the examples.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by dadhi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #595 on October 02, 2023 08:44.