]> Cypherpunks repositories - gostls13.git/commit
net: limit number of concurrent cgo calls
authorRuss Cox <rsc@golang.org>
Sat, 17 Aug 2013 02:43:05 +0000 (22:43 -0400)
committerRuss Cox <rsc@golang.org>
Sat, 17 Aug 2013 02:43:05 +0000 (22:43 -0400)
commit1d3efd6533773138ac7c9d8ca1314459636d55d2
tree4e8efe6ba2bb14aa911296ff799deec998a39241
parent665feeedcbef8a1c968d6da5be052e9fd9678380
net: limit number of concurrent cgo calls

The limit is 500. There is no way to change it.
This primarily affects name resolution.
If a million goroutines try to resolve DNS names,
only 500 will get to execute cgo calls at a time.
But in return the operating system will not crash.

Fixes #5625.

R=golang-dev, dan.kortschak, r, dvyukov
CC=bradfitz, golang-dev
https://golang.org/cl/13038043
src/pkg/net/cgo_unix.go
src/pkg/net/dialgoogle_test.go
src/pkg/net/lookup_windows.go
src/pkg/net/net.go