-
Notifications
You must be signed in to change notification settings - Fork 569
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
Support async/await session model #130
Merged
Merged
Changes from 1 commit
Commits
Show all changes
118 commits
Select commit
Hold shift + click to select a range
484c674
Initial checkin
badrishc fc89978
Merge branch 'master' into async-support
badrishc 63d1276
Merge branch 'master' into async-support
badrishc 0c7bddd
Merge branch 'master' into async-support
badrishc 3d17a2d
Merge branch 'master' into async-support
badrishc 2b7e24f
Rough sketch of session without touching currrent thread-local framew…
badrishc 00dc474
Improved support, added session pooling option, added session testcases.
badrishc 533652b
Updates to session support
badrishc 2fff5cb
Merge branch 'master' into async-support
badrishc 6c5420a
Merge branch 'master' into async-support
badrishc 4412113
Merge branch 'master' of https://github.com/Microsoft/FASTER into asy…
badrishc 366a8cc
Merge branch 'async-support' of https://github.com/Microsoft/FASTER i…
badrishc 0353678
Support large number of sessions (not limited by epoch table size). S…
badrishc 7a487e3
Update FASTER.core.csproj
badrishc 571333d
Initial checkin of async CompletePending - no tests yet.
badrishc d63603c
Merge branch 'async-support' of https://github.com/Microsoft/FASTER i…
badrishc c41855e
Update azure-pipelines.yml
badrishc 252ef54
Update azure-pipelines.yml
badrishc 2a2d7ac
Update azure-pipelines.yml
badrishc c67d882
Update azure-pipelines.yml
badrishc bcb75e7
Update azure-pipelines.yml
badrishc 2eafe9b
Support suspend/resume sessions
badrishc 0bd752e
Support true async CompleteCheckpoint
badrishc dbe13fd
Improved async sessions interface, working now. Does not persist doma…
badrishc 1754b68
Persist dormant sessions correctly.
badrishc a486834
Update testcase
badrishc d72c92a
Correct handling of thread switching with async
badrishc 869a88e
Merge branch 'master' into async-support
badrishc e5a4859
Merge branch 'async-support' of https://github.com/Microsoft/FASTER i…
badrishc 82a01a5
Update
badrishc 26be7f6
update
badrishc 733e4de
update
badrishc 30adeca
Updates and bugfixes
badrishc 9e84d63
Removing sample test code.
badrishc 9c60144
Update
badrishc d7064e8
Updated fast threadlocal
badrishc ea64fdf
Revert "Update"
badrishc 363508c
Merge remote-tracking branch 'origin/async-support-test2' into async-…
badrishc 789d38e
update
badrishc 572b8bd
revert max threads in pool
badrishc 4b75494
test
badrishc 026912c
test
badrishc 03c4d8e
Update azure-pipelines.yml for Azure Pipelines
badrishc e925af3
Update azure-pipelines.yml for Azure Pipelines
badrishc 1c33b49
Update azure-pipelines.yml
badrishc 4dc6d27
Update azure-pipelines.yml
badrishc 5cda2f9
more tests, phew
badrishc 68df34d
trying to reduce async context - incomplete
badrishc 7e80b07
Merge branch 'master' into async-support
badrishc 81a4a82
Merging from master
badrishc 75b9cb2
Update
badrishc b16212f
Updates
badrishc b2479ed
Merge branch 'async-support-test' of https://github.com/Microsoft/FAS…
badrishc d03bcea
Updates
badrishc 00fadc5
Merge branch 'master' into async-support-test
badrishc 27b677e
Fixes
badrishc 94b901e
Merge branch 'master' into async-support-test
badrishc 9afc5fb
Wired in excluded serial nos for commit points.
badrishc 62cecc8
Cleaning up interface and comments.
badrishc 6cab32a
Fixing thread local init, cleanup
badrishc 990d789
Merging from work branch
badrishc b9404b6
Fixing merge
badrishc 78c2649
Updates to support sessions natively without thread-local
badrishc e170463
updates
badrishc 38a26ff
Added tests
badrishc 0740f87
Merge branch 'async-support' into async-support-test
badrishc 669881d
Cleanup of warnings
badrishc 29c64e1
Merge branch 'master' into async-support-test
badrishc 16edd83
Initial checkin
badrishc 3077f52
Updates.
badrishc 853b3ea
Updates
badrishc 6315a14
Cleaned up epochs, improved fine grain scalability.
badrishc 19d5d82
Fixing test change
badrishc 4ef03bb
Merge branch 'fasterlog' into async-support
badrishc ce31917
Fixing break after merge.
badrishc 88d7269
Added commit and recovery support.
badrishc ddcc338
Added TryAppend so users can implement log throttling.
badrishc 2cd85e3
Fasterlog lowmem (#178)
badrishc ec2a3b5
Fasterlog TryAppend (#179)
badrishc bb4e357
minor fix
badrishc 4504937
merge
badrishc b06d112
Fasterlog async (#180)
badrishc 002b993
Merge branch 'master' into fasterlog
badrishc 944504b
Added tailing iterator WaitAsync to wait for iteration to proceed.
badrishc 540d1a5
Merge branch 'fasterlog' of https://github.com/Microsoft/FASTER into …
badrishc 80a2aeb
Convert Span to ReadOnlySpan for appends
badrishc 0050694
Added MemoryPool/IMemoryOwner variant of iterator
badrishc 127e908
Updates
badrishc 6dc7af6
Updated way to pin pooled memory
badrishc ff27448
Update azure-pipelines.yml
badrishc 72cdfdb
Merging from FasterLog branch for epoch and allocator goodness.
badrishc 0c0bf58
Updates to merge
badrishc 7565a21
Merging
badrishc 8e42a74
Support minimum buffer size of just 1 page!
badrishc 915f01e
Merge branch 'fasterlog' into async-support
badrishc 089d545
Cleanup and updates.
badrishc c55de3f
Actually checking in support for 1 page in memory, added initial draf…
badrishc db68ae0
Added a test
badrishc 5caea66
Improved sample, changed GetMemory to use byte[] instead of Span<byte>
badrishc e0f745f
Merging from fasterlog
badrishc fc47dbd
Merging goodness from master.
badrishc c4fba23
Merge branch 'master' into async-support
badrishc ca15128
Merge branch 'master' into async-support
badrishc 0f65fbb
Merge branch 'master' into async-support
badrishc 72ecc4f
Fixed break
badrishc a1b87a5
Merge branch 'master' into async-support
badrishc 6b03887
Merge branch 'master' into async-support
badrishc 876c0d3
Merging from master
badrishc b3cccd0
Fix merge
badrishc 1eca340
Major API cleanup and porting to session-based interface
badrishc 0237a0c
Added async API to sessions, added first draft of async sample.
badrishc 255c000
Added tests
badrishc a16c5eb
Update README.md
badrishc 95c0e58
Merge branch 'master' into async-support
badrishc 0624fd5
Updates based on review.
badrishc b31631b
Merge branch 'async-support' of https://github.com/microsoft/FASTER i…
badrishc ecbf696
Minor fixes.
badrishc 49866bf
fixed call to newsession
badrishc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Support large number of sessions (not limited by epoch table size). S…
…essions load their context into the thread-local context on every operation. Currently, we do not suspend sessions automatically after each operation. Slightly improved async API - not wired in.
- Loading branch information
commit 0353678ecf60c81a5018987024e206de081f549e
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT license. | ||
|
||
#pragma warning disable 0162 | ||
|
||
using System; | ||
using System.Collections.Concurrent; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace FASTER.core | ||
{ | ||
public unsafe partial class FasterKV<Key, Value, Input, Output, Context, Functions> : FasterBase, IFasterKV<Key, Value, Input, Output, Context> | ||
where Key : new() | ||
where Value : new() | ||
where Functions : IFunctions<Key, Value, Input, Output, Context> | ||
{ | ||
/// <summary> | ||
/// Start new shared (not thread-specific) session with FASTER | ||
/// </summary> | ||
/// <returns></returns> | ||
public ClientSession<Key, Value, Input, Output, Context, Functions> StartClientSession() | ||
{ | ||
Guid guid = Guid.NewGuid(); | ||
var ctx = new FasterExecutionContext(); | ||
InitContext(ctx, guid); | ||
var prevCtx = new FasterExecutionContext(); | ||
InitContext(prevCtx, guid); | ||
return new ClientSession<Key, Value, Input, Output, Context, Functions>(this, prevCtx, ctx); | ||
} | ||
|
||
|
||
internal void SetContext(FasterExecutionContext prevThreadCtx, FasterExecutionContext threadCtx) | ||
{ | ||
if (!epoch.ThreadEntry.IsInitializedForThread) | ||
{ | ||
epoch.Acquire(); | ||
epoch.ThreadEntry.InitializeThread(); | ||
this.prevThreadCtx.InitializeThread(); | ||
this.threadCtx.InitializeThread(); | ||
} | ||
this.prevThreadCtx.Value = prevThreadCtx; | ||
this.threadCtx.Value = threadCtx; | ||
Refresh(); | ||
} | ||
|
||
/// <summary> | ||
/// Suspend session with FASTER | ||
/// </summary> | ||
internal void SuspendSession(bool completePending = false) | ||
{ | ||
if (completePending) | ||
{ | ||
while (true) | ||
{ | ||
bool done = true; | ||
if (threadCtx.Value.retryRequests.Count != 0 || threadCtx.Value.ioPendingRequests.Count != 0) | ||
done = false; | ||
|
||
if (prevThreadCtx.Value != default(FasterExecutionContext)) | ||
{ | ||
if (prevThreadCtx.Value.retryRequests.Count != 0 || prevThreadCtx.Value.ioPendingRequests.Count != 0) | ||
done = false; | ||
} | ||
if (threadCtx.Value.phase != Phase.REST) | ||
done = false; | ||
|
||
if (done) break; | ||
Refresh(); | ||
} | ||
} | ||
epoch.Release(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to say how it is unsafe here