Re:Go as an alternative to Node.js for Very Fast Servers
by tptacek on Friday February 22, 2013 @07:08PM
(#5267813)
Blocking system calls spawn OS threads in Go, which can be cached and recycled for new goroutines. You don't see this if you code to pkg/net because it multiplexes i/o with a select/kqueue goroutine, but you'll see it right away if you code directly to the syscalls.
Close isn't a blocking call, though.
Re:Go as an alternative to Node.js for Very Fast Servers
by _stephan on Saturday February 23, 2013 @09:00AM
(#5269648)
Close is annotated as a blocking syscall in http://golang.org/src/pkg/syscall/syscall_linux.go#L810
Is there a guarantee on Linux that close can't block? (I suppose it depends on the file type and the definition of blocking.)
I highly doubt that it is creating a thread per goro on client disconnect. If you have a minimalish example of this, the golang mailing list would be very interested in working with you to identify what went wrong and create a patch if it is an issue with the Go implementation.