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#] Add locking methods to Functions #428

Merged
merged 8 commits into from
Mar 13, 2021
Merged

[C#] Add locking methods to Functions #428

merged 8 commits into from
Mar 13, 2021

Conversation

TedHartMS
Copy link
Contributor

@TedHartMS TedHartMS commented Mar 10, 2021

Add the following to IFunctions and IAdvancedFunctions. Functions implementations that do not inherit from (Advanced)FunctionsBase must provide an implementation of these.

    // If true, FASTER calls Lock() and Unlock() where appropriate. Currently this is the 4 concurrent callback methods:
    // ConcurrentReader, ConcurrentWriter, ConcurrentDeleter (new in IAdvancedFunctions), and InPlaceUpdater.
    bool SupportsLocking { get; }

    // FunctionsBase illustrates the default implementation of these as an exclusive lock using a bit in RecordInfo
    void Lock(ref RecordInfo recordInfo, ref Key key, ref Value value, LockType lockType, ref long lockContext);
    bool Unlock(ref RecordInfo recordInfo, ref Key key, ref Value value, LockType lockType, long lockContext);

Add a new method ConcurrentDeleter to IAdvancedFunctions. This may return false for default deletion handling (setting tombstone, and setting object types to null), or may implement its own delete handling (which must set tombstone) and return true.

Add FASTER.benchmark: -z, --locking option to exercise

@TedHartMS TedHartMS requested a review from badrishc March 10, 2021 20:18
…ASTER will only call if SupportsLocking is true; use inheritdoc in FunctionsBase
@badrishc badrishc changed the title Add locking methods to Functions [C#] Add locking methods to Functions Mar 11, 2021
@badrishc badrishc merged commit 7107010 into master Mar 13, 2021
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.

2 participants