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

Atomic operations #117

Open
jcarreira opened this issue Aug 1, 2017 · 7 comments
Open

Atomic operations #117

jcarreira opened this issue Aug 1, 2017 · 7 comments

Comments

@jcarreira
Copy link
Owner

We need to provide an interface for atomic operations at the object store level for synchronization between tasks.

I propose these three operations:

  1. atomic set (set integer value)
  2. atomic increment
  3. atomic decrement

I think the way to go about doing this is to make these operations send (as in RDMA send) a message (in opposition to a RDMA write) and make the server handle these operations in a serial fashion.

@TylerADavis Can you look into this?

@TylerADavis
Copy link
Collaborator

I've got an idea of how to do this on TCP as the TCP server is currently single threaded and thus serial by nature when processing (messages might not be processed in the order received necessarily due to the use of poll, but all state in the store is changed atomically), and it seems that the only requirement here would be adding three new message types, as well as code to process them.

I'm less sure of how the RDMA side of things would work, but I'd expect to be able to repurpose the fetchadd sync code. I'll look more into this.

@jcarreira
Copy link
Owner Author

Yes, RDMA should not be much different. It should be similar to sending an allocate command to the server.

@TylerADavis
Copy link
Collaborator

For the RDMA server, my understanding is that the server is unaware of the ObjectID associated with any particular piece of memory. As such, should these atomic operations make use of some separate map that maps an "AtomicID" to a value?

Additionally, what should the atomic operations return? It would almost seem beneficial to have some sort of atomic fetch and an atomic exchange/test and set operation

@jcarreira
Copy link
Owner Author

Let's start with the TCP and leave this interface unimplemented in the RDMA side of things.

These operations can just return a boolean to indicate success (basically true most of the times). Others might be more special (test-and-set needs to return the old value).

@TylerADavis
Copy link
Collaborator

Alright, I'll add some implementation details to the high level design doc and run it by you before I get to work implementing it

@TylerADavis
Copy link
Collaborator

I've added an outline to the high level design doc. My basic plan is as to add the following operations, and make use of a separate key space for the atomics than the regular objects. Not all these operations will be present at the client level, as increment, decrement, and fetch sub can all be built off of fetch add.

Set
Increment
Decrement
Fetch add?
Fetch sub
Exchange

@TylerADavis
Copy link
Collaborator

TylerADavis commented Aug 8, 2017

As an update to this, I've currently got it working at the network client and server levels, the next step is to set up template specialization on the store so that the methods can only be called if the store is of the atomic type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants