Thread ID in glog

71 views
Skip to first unread message

Ramya Raj

unread,
Aug 19, 2019, 5:05:55 PM8/19/19
to golan...@googlegroups.com
Hey!

In this line, are you planning to change pid to thread ID? I would like to use glogs to display different IDs for each worker thread.

Thanks,
Ramya

Ian Lance Taylor

unread,
Aug 19, 2019, 5:13:51 PM8/19/19
to Ramya Raj, golang-nuts
On Mon, Aug 19, 2019 at 2:05 PM Ramya Raj <ramya...@gmail.com> wrote:
>
> In this line, are you planning to change pid to thread ID? I would like to use glogs to display different IDs for each worker thread.

I'm not sure about that comment. The thread ID would likely be
unhelpful, as goroutines migrate between threads. And the goroutine
ID is unavailable, as discussed at
https://golang.org/doc/faq#no_goroutine_id .

Ian
Reply all
Reply to author
Forward
0 new messages