Is getting the thread ID expensive in terms of performance?

后端 未结 3 1655
逝去的感伤
逝去的感伤 2021-01-13 04:05

I need to access the thread ID from threads that I don\'t control (it\'s in an asynchronous callback function, and it get called from a set of different threads).

I

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-13 04:57

    Why not using thread local storage? http://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_local_storage.html

提交回复
热议问题