summaryrefslogtreecommitdiff
path: root/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2017-10-04 10:44:24 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2017-10-04 10:47:08 +0200
commit25cc35b0e4942e990c01ac6224720e8fe84fd9ae (patch)
tree12cd345922388df70ac4498570659d6c6990a7e5 /opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt
parent2c26e9c91c945af065770c323e8b80a9f5104379 (diff)
bug(#9): Fix interference between experiments
This change fixes the interference of multiple experiments running at the same time due to some thread unsafe behaviour in the JpaExperimentManager class. The code has now been restructured to solve the issue and fix the thread unsafe behaviour. Closes #9.
Diffstat (limited to 'opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt')
-rw-r--r--opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt4
1 files changed, 3 insertions, 1 deletions
diff --git a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt
index 333609bb..b3d67568 100644
--- a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt
+++ b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt
@@ -30,9 +30,10 @@ import nl.atlarge.opendc.kernel.Context
import nl.atlarge.opendc.kernel.Process
import nl.atlarge.opendc.kernel.time.Duration
import nl.atlarge.opendc.platform.scheduler.Scheduler
+import nl.atlarge.opendc.platform.workload.Job
+import nl.atlarge.opendc.platform.workload.Task
import nl.atlarge.opendc.topology.Entity
import nl.atlarge.opendc.topology.machine.Machine
-import nl.atlarge.opendc.platform.workload.Task
import java.util.*
/**
@@ -88,6 +89,7 @@ interface Datacenter : Entity<Unit>, Process<Datacenter> {
while (queue.isNotEmpty()) {
val msg = queue.poll()
if (msg is Task) {
+ msg.arrive(time)
scheduler.submit(msg)
}
}