Skip to content

Commit

Permalink
Updates to merge
Browse files Browse the repository at this point in the history
  • Loading branch information
badrishc committed Oct 5, 2019
1 parent 72cdfdb commit 0c0bf58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 28 deletions.
26 changes: 0 additions & 26 deletions cs/src/core/Epochs/LightEpoch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -227,32 +227,6 @@ public void Resume()
ProtectAndDrain();
}

/// <summary>
/// Thread suspends its epoch entry
/// </summary>
public void Suspend()
{
int entry = threadEntryIndex.Value;
if (kInvalidIndex == entry)
{
return;
}
(*(tableAligned + entry)).localCurrentEpoch = int.MaxValue;
}

/// <summary>
/// Thread resumes its epoch entry
/// </summary>
public void Resume()
{
if (!threadEntryIndex.IsInitializedForThread || threadEntryIndex.Value == kInvalidIndex)
{
Acquire();
}
}

internal FastThreadLocal<int> ThreadEntry => threadEntryIndex;

/// <summary>
/// Increment global current epoch
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion cs/src/core/Index/FasterLog/FasterLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public async ValueTask WaitForCommitAsync(long untilAddress = 0)
public long FlushAndCommit(bool spinWait = false)
{
epoch.Resume();
allocator.ShiftReadOnlyToTail(out long tailAddress);
allocator.ShiftReadOnlyToTail(out long tailAddress, out _);

if (spinWait)
{
Expand Down
7 changes: 6 additions & 1 deletion cs/test/FasterLogTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Licensed under the MIT license.

using System;
using System.IO;
using System.Linq;
using FASTER.core;
using NUnit.Framework;
Expand All @@ -13,21 +14,25 @@ namespace FASTER.test
internal class FasterLogTests
{
const int entryLength = 100;
const int numEntries = 1000000;
const int numEntries = 100;
private FasterLog log;
private IDevice device;


[SetUp]
public void Setup()
{
if (File.Exists(TestContext.CurrentContext.TestDirectory + "\\fasterlog.log.commit"))
File.Delete(TestContext.CurrentContext.TestDirectory + "\\fasterlog.log.commit");
device = Devices.CreateLogDevice(TestContext.CurrentContext.TestDirectory + "\\fasterlog.log", deleteOnClose: true);
}

[TearDown]
public void TearDown()
{
device.Close();
if (File.Exists(TestContext.CurrentContext.TestDirectory + "\\fasterlog.log.commit"))
File.Delete(TestContext.CurrentContext.TestDirectory + "\\fasterlog.log.commit");
}

[Test]
Expand Down

0 comments on commit 0c0bf58

Please sign in to comment.