mirror of
https://github.com/safing/portbase
synced 2025-09-01 18:19:57 +00:00
Set default microtask threshold in init for easier override
This commit is contained in:
parent
d21c8e6cda
commit
70b58138b9
2 changed files with 2 additions and 3 deletions
|
@ -30,7 +30,8 @@ const (
|
||||||
func init() {
|
func init() {
|
||||||
var microTasksVal int32
|
var microTasksVal int32
|
||||||
microTasks = µTasksVal
|
microTasks = µTasksVal
|
||||||
var microTasksThreshholdVal int32
|
|
||||||
|
microTasksThreshholdVal := int32(runtime.GOMAXPROCS(0) * 2)
|
||||||
microTasksThreshhold = µTasksThreshholdVal
|
microTasksThreshhold = µTasksThreshholdVal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue