Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sim doesn't start the proper count of workers #4

Closed
db47h opened this issue Jun 10, 2018 · 0 comments
Closed

Sim doesn't start the proper count of workers #4

db47h opened this issue Jun 10, 2018 · 0 comments

Comments

@db47h
Copy link
Owner

db47h commented Jun 10, 2018

hwsim/hwsim.go

Lines 237 to 247 in ae8bccb

size := len(ups) / workers
if size*workers < len(ups) {
size++
}
for len(ups) > 0 {
size = min(size, len(ups))
wc := make(chan struct{}, 1)
cc.wc = append(cc.wc, wc)
go worker(cc, ups[:size], wc)
ups = ups[size:]
}

If len(ups) is for example 9 and workers is 8, it will start only 9 / ((9/8)+1) = 4 workers.

@db47h db47h closed this as completed in 973fda3 Jun 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant