Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

number of goroutine for decoding with regard to go-osmpbf #3

Open
kkdd opened this issue May 21, 2015 · 2 comments
Open

number of goroutine for decoding with regard to go-osmpbf #3

kkdd opened this issue May 21, 2015 · 2 comments

Comments

@kkdd
Copy link

kkdd commented May 21, 2015

When using go-osmpbf (https://github.com/qedus/osmpbf),
fmp.Printf("number of goroutines for decoding = %d", runtime.GOMAXPROCS(-1))
would print helpful information. I suspect it to be one.

Note that it is used in the code as follows:
err = d.Start(runtime.GOMAXPROCS(-1)) // use several goroutines for faster decoding

@missinglink
Copy link
Contributor

hey @kkdd this is being set to -1 like you said, which is why it's the fastest from the test results, what makes you think it's still bound to a single core?

@kkdd
Copy link
Author

kkdd commented Jun 27, 2015

I finally understand Goroutine's threads as follows:

ncpu := 2  // specifying the number of CPU which Golang uses
runtime.GOMAXPROCS(ncpu)  // Note that ncpu == runtime.GOMAXPROCS(-1)
err = d.Start(ncpu)  // specifying the number of Goroutine's threads

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants