From 4e9a6ae97039d735d03ea4d8f6e28771f1a2b31b Mon Sep 17 00:00:00 2001 From: "Stanislav N. aka pztrn" Date: Fri, 4 Nov 2016 18:46:07 +0500 Subject: [PATCH] GLib threads initialization. --- requester/pooler.go | 3 ++- ui/mainwindow_init.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/requester/pooler.go b/requester/pooler.go index bbc7640..cc158d0 100644 --- a/requester/pooler.go +++ b/requester/pooler.go @@ -14,7 +14,7 @@ import ( "errors" "fmt" "net" - //"runtime" + "runtime" "strconv" "strings" "sync" @@ -35,6 +35,7 @@ func (p *Pooler) Initialize() { fmt.Println("Initializing requester goroutine pooler...") // ToDo: figure out how to make this work nice. p.maxrequests = 100 + _ = runtime.GOMAXPROCS(runtime.NumCPU() * 4) p.pp = "\377\377\377\377" fmt.Println("Pooler initialized") } diff --git a/ui/mainwindow_init.go b/ui/mainwindow_init.go index a0cdd09..1d547e9 100644 --- a/ui/mainwindow_init.go +++ b/ui/mainwindow_init.go @@ -20,6 +20,7 @@ import ( // Main window initialization. func (m *MainWindow) Initialize() { + glib.ThreadInit(nil) gdk.ThreadsInit() gdk.ThreadsEnter()