tweeked fences?

This commit is contained in:
mcrcortex
2025-06-10 20:45:39 +10:00
parent 6398164d42
commit 84c07c4115
3 changed files with 3 additions and 9 deletions

View File

@@ -29,9 +29,7 @@ public class TimingStatistics {
throw new IllegalStateException(); throw new IllegalStateException();
} }
this.running = true; this.running = true;
VarHandle.fullFence();
this.timestamp = System.nanoTime(); this.timestamp = System.nanoTime();
VarHandle.fullFence();
} }
public void stop() { public void stop() {
@@ -39,9 +37,7 @@ public class TimingStatistics {
throw new IllegalStateException(); throw new IllegalStateException();
} }
this.running = false; this.running = false;
VarHandle.fullFence();
this.runtime += System.nanoTime() - this.timestamp; this.runtime += System.nanoTime() - this.timestamp;
VarHandle.fullFence();
} }
public void subtract(TimeSampler sampler) { public void subtract(TimeSampler sampler) {

View File

@@ -74,8 +74,6 @@ public class ModelBakerySubsystem {
} }
}*/ }*/
//TimingStatistics.modelProcess.start(); //TimingStatistics.modelProcess.start();
long start = System.nanoTime();
VarHandle.fullFence();
if (this.blockIdCount.get() != 0) { if (this.blockIdCount.get() != 0) {
long budget = Math.min(totalBudget-150_000, totalBudget-(this.factory.resultJobs.size()*10_000L))-150_000; long budget = Math.min(totalBudget-150_000, totalBudget-(this.factory.resultJobs.size()*10_000L))-150_000;
@@ -100,7 +98,7 @@ public class ModelBakerySubsystem {
this.factory.tick(); this.factory.tick();
start = System.nanoTime(); long start = System.nanoTime();
while (!this.factory.resultJobs.isEmpty()) { while (!this.factory.resultJobs.isEmpty()) {
this.factory.resultJobs.poll().run(); this.factory.resultJobs.poll().run();
if (totalBudget<(System.nanoTime()-start)) if (totalBudget<(System.nanoTime()-start))

View File

@@ -130,9 +130,9 @@ public class ActiveSectionTracker {
} }
section.acquire(); section.acquire();
VarHandle.fullFence();//Do not reorder setting this object VarHandle.storeStoreFence();//Do not reorder setting this object
holder.obj = section; holder.obj = section;
VarHandle.fullFence(); VarHandle.releaseFence();
if (nullOnEmpty && status == 1) {//If its air return null as stated, release the section aswell if (nullOnEmpty && status == 1) {//If its air return null as stated, release the section aswell
section.release(); section.release();
return null; return null;