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

Implemented the RegisterOnTermination feature. #1523

Merged
merged 1 commit into from
Dec 10, 2015

Conversation

marcpiechura
Copy link
Contributor

closes #1519
It also implements some of the tests for #60.

/// </summary>
/// <param name="newValue">The new value</param>
/// <returns>The current value</returns>
public T GetAndSet(T newValue)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This implementation doesn't seem to be atomic. This operation is basically equivalent of return Interlocked.Exchange(ref atomicValue, newValue). Using [MethodImpl(MethodImplOptions.AggressiveInlining)] also could be valuable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I struggled with this one, thanks for the hint, will update the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interlocked.Exchange unfortunately only allows reference types in the generic version.

@Aaronontheweb
Copy link
Member

Looks great! How does this integrate with the termination hooks for Akka.Remote? Or does this live as a separate system?

private class RemotingTerminator : FSM<TerminatorState, Internals>

If the RemotingTerminator needs to be modified, we can do that as a separate issue.

@marcpiechura
Copy link
Contributor Author

Sorry, but through my low understanding about Akka.Remote I can't give an appropriate answer.

@Aaronontheweb
Copy link
Member

@Silv3rcircl3 ok, no worries Marc - I'll add that as something for me to investigate

Aaronontheweb added a commit that referenced this pull request Dec 10, 2015
Implemented the RegisterOnTermination feature.
@Aaronontheweb Aaronontheweb merged commit 234e5a0 into akkadotnet:dev Dec 10, 2015
@marcpiechura marcpiechura mentioned this pull request Dec 11, 2015
@marcpiechura marcpiechura deleted the RegisterOnTermination branch December 11, 2015 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement RegisterOnTermination
4 participants