From f0545d5e25d43c6def5aca305903f04b9b5d432c Mon Sep 17 00:00:00 2001 From: ragnar Date: Sat, 2 Mar 2024 23:49:35 +0100 Subject: [PATCH] remove scheduler references --- .../philosophers/PhilosopherCompetition.scala | 10 +++------- .../main/scala/benchmarks/simple/MultiReverseFan.scala | 4 ++-- .../main/scala/benchmarks/simple/NaturalGraph.scala | 2 +- .../src/main/scala/benchmarks/simple/ReverseFan.scala | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Modules/Microbenchmarks/src/main/scala/benchmarks/philosophers/PhilosopherCompetition.scala b/Modules/Microbenchmarks/src/main/scala/benchmarks/philosophers/PhilosopherCompetition.scala index cdc1c75cc..c8eb7b191 100644 --- a/Modules/Microbenchmarks/src/main/scala/benchmarks/philosophers/PhilosopherCompetition.scala +++ b/Modules/Microbenchmarks/src/main/scala/benchmarks/philosophers/PhilosopherCompetition.scala @@ -37,7 +37,7 @@ class PhilosopherCompetition { def tryUpdateCycle(comp: Competition)(seating: comp.stableTable.Seating): Boolean = { val res = comp.stableTable.tryEat(seating) - if (res) seating.philosopher.set(Thinking)(using comp.stableTable.engine.global.scheduler) + if (res) seating.philosopher.set(Thinking) !res } @@ -69,9 +69,7 @@ class PhilosopherCompetition { try { thirdLock.lock() try { - seating.philosopher.set(Thinking)( - using comp.stableTable.engine.global.scheduler, - ) + seating.philosopher.set(Thinking) } finally { thirdLock.unlock() } } finally { secondLock.unlock() } } finally { firstLock.unlock() } @@ -127,9 +125,7 @@ class Competition extends BusyThreads { table.eaten.set(0) stableTable.seatings.foreach { seat => val phil: stableTable.engine.Var[Philosopher] = seat.philosopher - phil.set(Thinking)( - using stableTable.engine.global.scheduler, - ) + phil.set(Thinking) } } diff --git a/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/MultiReverseFan.scala b/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/MultiReverseFan.scala index 22d53ae7f..d980b222a 100644 --- a/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/MultiReverseFan.scala +++ b/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/MultiReverseFan.scala @@ -47,11 +47,11 @@ class MultiReverseFan { @Benchmark def run(step: Step, params: ThreadParams): Unit = { val index = params.getThreadIndex - if (locks == null) sources(index).set(step.run())(using global.scheduler) + if (locks == null) sources(index).set(step.run()) else { locks(index / groupSize).lock() try { - sources(index).set(step.run())(using global.scheduler) + sources(index).set(step.run()) } finally locks(index / groupSize).unlock() } } diff --git a/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/NaturalGraph.scala b/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/NaturalGraph.scala index 1d0c8c9a8..f4b534bb5 100644 --- a/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/NaturalGraph.scala +++ b/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/NaturalGraph.scala @@ -86,6 +86,6 @@ class NaturalGraph { } @Benchmark - def run(step: Step): Unit = source.set(step.run())(using global.scheduler) + def run(step: Step): Unit = source.set(step.run()) } diff --git a/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/ReverseFan.scala b/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/ReverseFan.scala index 63b3529cd..d2fa4edfb 100644 --- a/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/ReverseFan.scala +++ b/Modules/Microbenchmarks/src/main/scala/benchmarks/simple/ReverseFan.scala @@ -39,7 +39,7 @@ class ReverseFan { @Benchmark def run(step: Step, params: ThreadParams): Unit = if (isManual) synchronized { - sources(params.getThreadIndex).set(step.run())(using global.scheduler) + sources(params.getThreadIndex).set(step.run()) } - else sources(params.getThreadIndex).set(step.run())(using global.scheduler) + else sources(params.getThreadIndex).set(step.run()) }