You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: core/kotlinx-coroutines-core/src/main/kotlin/kotlinx/coroutines/experimental/scheduling/CoroutineScheduler.kt
+4-5Lines changed: 4 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -161,14 +161,13 @@ internal class CoroutineScheduler(
161
161
}
162
162
163
163
workers = arrayOfNulls(maxPoolSize)
164
-
// todo: can we lazily create corePool, too?
165
-
// todo: The goal: when running "small" workload on "large" machine we should not consume extra resource in advance
166
-
// todo: Can't we just invoke createNewWorker here to get the first one up and running?
167
-
for (i in0 until corePoolSize) {
164
+
// By default create at most 2 workers and allocate next ones lazily
Copy file name to clipboardExpand all lines: core/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/scheduling/CoroutineDispatcherTest.kt
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ class CoroutineDispatcherTest : SchedulerTestBase() {
Copy file name to clipboardExpand all lines: core/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/scheduling/CoroutineSchedulerShrinkTest.kt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ class CoroutineSchedulerShrinkTest : SchedulerTestBase() {
23
23
// Init dispatcher
24
24
async(dispatcher) { }.await()
25
25
// Pool is initialized with core size in the beginning
Copy file name to clipboardExpand all lines: core/kotlinx-coroutines-core/src/test/kotlin/kotlinx/coroutines/experimental/scheduling/SchedulerTestBase.kt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,8 @@ abstract class SchedulerTestBase : TestBase() {
44
44
require(threads == expectedThreadsCount) { "Expected $expectedThreadsCount threads, but has $threads" }
0 commit comments