Looking at all goroutines with runnable state seem to be the solution but I 
am not very sure about this.

*goroutine 15825281 [runnable]*

On Tuesday, January 12, 2021 at 9:16:47 PM UTC+5:30 varun...@gmail.com 
wrote:

> 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
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/36113771-fb9b-4468-875f-e039db30ba7bn%40googlegroups.com.

Reply via email to