Re:Goroutines and APIs
by denormalfloat on Tuesday November 19, 2019 @03:14AM
(#21571391)
Yes, they still need unlimited kernel threads (for liveness reasons). When I asked a few years back about this, go-nuts@ suggested implemented my own rate limiting in application space.
In my case, it was for running Go on a resource constrained Raspberry-PI, where the kernel threads could easily live too long, and use up all memory. The threads were calling read(2) on a network mounted fuse fs, and would last for 30s+.
Which operations need kernel threads? There is runtime.LockOSThread if you need underlying thread affinity, but I'm not aware of any other mechanism to interact with the underlying threads of execution.
Re:Goroutines and APIs
by ridiculous_fish on Tuesday November 19, 2019 @12:52AM
(#21570923)
For example os.Stat()
Is this still the case? How does modern Go handle operations which require kernel threads?