Hi, I would like to know how to identify mapping between an OS thread and go-routine from the stack trace i.e. which go-routine is scheduled for execution on a OS thread.
Background: My application spawns very large number of go-routines (upto 2M) for heavy data processing. In some cases, I am seeing the thread exhaustion limit panic
runtime: program exceeds 10000-thread limit
fatal error: thread exhaustion
I have the complete stack trace from the panic but I am not sure which go-routine is spawned on a OS thread and which is not. Is there any way to identify that?
The purpose of this identification is to throttle the calls that require a new OS thread to be spawned there by avoiding the thread exhaustion limit.
Thanks,
Varun