Set default microtask threshold in init for easier override

This commit is contained in:
Daniel 2022-11-04 16:11:38 +01:00
parent d21c8e6cda
commit 70b58138b9
2 changed files with 2 additions and 3 deletions

View file

@ -30,7 +30,8 @@ const (
func init() { func init() {
var microTasksVal int32 var microTasksVal int32
microTasks = &microTasksVal microTasks = &microTasksVal
var microTasksThreshholdVal int32
microTasksThreshholdVal := int32(runtime.GOMAXPROCS(0) * 2)
microTasksThreshhold = &microTasksThreshholdVal microTasksThreshhold = &microTasksThreshholdVal
} }

View file

@ -4,7 +4,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"os" "os"
"runtime"
"github.com/tevino/abool" "github.com/tevino/abool"
@ -36,7 +35,6 @@ func Start() error {
defer mgmtLock.Unlock() defer mgmtLock.Unlock()
// start microtask scheduler // start microtask scheduler
SetMaxConcurrentMicroTasks(runtime.GOMAXPROCS(0))
go microTaskScheduler() go microTaskScheduler()
// inter-link modules // inter-link modules