remove httpcontext from rolename initializer#1340
Conversation
|
@Dmitry-Matveev, we need to re-test performance after this merges |
|
|
||
| set | ||
| { | ||
| if (value != roleName) |
There was a problem hiding this comment.
why not using Interlocked.CompareExchange for comparison and exchange?
There was a problem hiding this comment.
Simple answer is, i didn't know the correct way to use CompareExchange.
Now that I have better test coverage, i'll take another look at this. :)
There was a problem hiding this comment.
If you know something I don't, please share. :)
From what I'm reading, CompareExchange will always replace the ref variable with an incoming value.
In my use case, I only need to replace the ref variable when the incoming value does not match.
Specifically, when a VIP SWAP occurs, we need to update the role name.
My understanding is, replacing this with a CompareExchange will always replace the ref variable with the incoming value regardless of if it's new.
I believe CompareExchange doesn't help me in this use case.
But please correct me if i'm wrong.
No description provided.