diff options
| author | Fabian Mastenbroek <mail.fabianm@gmail.com> | 2022-10-05 14:44:43 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-05 14:44:43 +0200 |
| commit | c2047d09b27b0c05f5c203509dde524e17d3b729 (patch) | |
| tree | 3903d8aed5e87850c92e1b2dce8379ea99bdfa6d /opendc-experiments/opendc-experiments-faas | |
| parent | ec3b5b462c1b8296ba18a3872f56d569fa70e45b (diff) | |
| parent | be176910eb870209576326ffaad8bf21241fccbd (diff) | |
merge: Extract scheduler from simulation coroutine dispatcher (#106)
This pull request extracts the scheduler from the `SimulationCoroutineDispatcher` into
a separate `SimulationScheduler` class which allows users to re-use the scheduler
between different coroutine dispatchers.
We implement the `SimulationScheduler` in Java, removing the explicit dependency on
Kotlin or `kotlinx-coroutines`. The scheduler uses a separate specialized priority queue
implementation that eliminates allocation in the hot path of the simulator.
## Implementation Notes :hammer_and_pick:
* Add Java-based simulator core
* Use SimulationScheduler in coroutine dispatcher
* Rename runBlockingSimulation to runSimulation
## External Dependencies :four_leaf_clover:
* N/A
## Breaking API Changes :warning:
* The Kotlin API for simulation has been moved to `org.opendc.simulator.kotlin`.
* `runBlockingSImulation` renamed to `runSimulation`
Diffstat (limited to 'opendc-experiments/opendc-experiments-faas')
| -rw-r--r-- | opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt b/opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt index 98328d3e..6f212825 100644 --- a/opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt +++ b/opendc-experiments/opendc-experiments-faas/src/test/kotlin/org/opendc/experiments/faas/FaaSExperiment.kt @@ -34,7 +34,7 @@ import org.opendc.simulator.compute.model.MachineModel import org.opendc.simulator.compute.model.MemoryUnit import org.opendc.simulator.compute.model.ProcessingNode import org.opendc.simulator.compute.model.ProcessingUnit -import org.opendc.simulator.core.runBlockingSimulation +import org.opendc.simulator.kotlin.runSimulation import java.io.File import java.time.Duration @@ -46,7 +46,7 @@ class FaaSExperiment { * Smoke test that simulates a small trace. */ @Test - fun testSmoke() = runBlockingSimulation { + fun testSmoke() = runSimulation { val faasService = "faas.opendc.org" Provisioner(coroutineContext, clock, seed = 0L).use { provisioner -> |
