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

[C#] Growing Values in RMW operations #512

Closed
pablofrommars opened this issue Jun 24, 2021 · 2 comments
Closed

[C#] Growing Values in RMW operations #512

pablofrommars opened this issue Jun 24, 2021 · 2 comments

Comments

@pablofrommars
Copy link

Similar to the problem described in #136. It would useful to be able to increase/modify the size of values during RMW operations. IFunctions.CopyUpdater allocates the size of newValue equals to the size of the old value.

Looks like the c++ port has support for the feature (#145), Is there a workaround for c#?

Thanks to anyone involved!

@badrishc
Copy link
Contributor

This is already supported. The basic idea is:

  1. Return false from InPlaceUpdater
  2. FASTER will call GetLength (provided via SessionVariableLengthStructSettings parameter to NewSession) to get the size of the new value given the old value and the input.
  3. FASTER will allocate this (larger) length, and call CopyUpdater with new value of this length.

See example here: https://github.com/microsoft/FASTER/blob/master/cs/samples/StoreVarLenTypes/AsciiSumSample.cs

@pablofrommars
Copy link
Author

That's great news for my use case.

Thank you so much for the lightning fast support.

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

No branches or pull requests

2 participants