Skip to content

Commit

Permalink
fix: incorrect semaphore initialization (#411)
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel authored Jun 15, 2023
1 parent 4392bab commit a3b568a
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 20 deletions.
6 changes: 4 additions & 2 deletions ecc/bls12-377/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bls12-378/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bls12-381/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bls24-315/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bls24-317/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bn254/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bw6-633/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bw6-756/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions ecc/bw6-761/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion ecc/secp256k1/multiexp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion internal/generator/ecc/template/multiexp.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ func _innerMsm{{ $.UPointName }}(p *{{ $.TJacobian }}, c uint64, points []{{ $.T
// (only if nbTasks < nbCPU)
var sem chan struct{}
if config.NbTasks < runtime.NumCPU() {
sem = make(chan struct{}, config.NbTasks * 2) // *2 because if chunk is overweight we split it in two
// we add nbChunks because if chunk is overweight we split it in two
sem = make(chan struct{}, config.NbTasks + int(nbChunks))
for i:=0; i < config.NbTasks; i++ {
sem <- struct{}{}
}
Expand Down

0 comments on commit a3b568a

Please sign in to comment.