fixed disabled concurrency in CLI
This commit is contained in:
1 parent
1cead7822a
commit
161f3f74e2
4 files changed
+92
-18
No files matched your search
+11
-16
@@ -50,23 +50,18 @@ fn piSpigot(iThread: Int, n: Int) {
|
||||
println(iThread, " - done: ", s)
|
||||
}
|
||||
|
||||
|
||||
var counter = 0
|
||||
|
||||
val t0 = Instant()
|
||||
(1..TASK_COUNT).map { n ->
|
||||
val counterState = counter
|
||||
val t = launch {
|
||||
piSpigot(counterState, WORK_SIZE)
|
||||
}
|
||||
++counter
|
||||
t
|
||||
}.forEach { (it as Deferred).await() }
|
||||
|
||||
for( repeat in 1..30) {
|
||||
val t0 = Instant()
|
||||
(1..TASK_COUNT).map {
|
||||
val counterState = counter
|
||||
val t = launch {
|
||||
piSpigot(counterState, WORK_SIZE)
|
||||
}
|
||||
++counter
|
||||
t
|
||||
}.forEach { (it as Deferred).await() }
|
||||
val dt = Instant() - t0
|
||||
|
||||
val dt = Instant() - t0
|
||||
|
||||
println("$repeat: all done, dt = ", dt)
|
||||
delay(1000)
|
||||
}
|
||||
println("all done, dt = ", dt)
|
||||
Reference in new issue
Block a user