给boost线程命名? [英] Give a name to a boost thread?

查看:141
本文介绍了给boost线程命名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以给 boost :: thread 命名,以便调试器表和崩溃日志更可读?如何?

Is it possible to give a name to a boost::thread so that the debuggers tables and the crash logs can be more readable? How?

推荐答案

您需要访问底层线程原语并以系统相关方式分配名称。调试和崩溃日志本质上是系统依赖的,而boost :: thread更多关于非系统依赖,即关于可移植性。

You would need to access the underlying thread primitive and assign a name in a system dependent manner. Debugging and crash logs are inherently system dependent and boost::thread is more about non-system-dependency, i.e. about portability.

看起来( http://www.boost.org/doc/libs/1_43_0/doc/html/thread .html ),没有文档化的方式来访问boost线程的底层系统资源。 (但我从来没有用过它,所以我可能会错过一些东西。)

It seems ( http://www.boost.org/doc/libs/1_43_0/doc/html/thread.html ) that there is no documented way to access underlying system resources for a boost thread. (But I have never used it myself so I may miss something.)

(大卫写在评论中) http://www.boost.org/doc/libs/1_43_0 /doc/html/thread/thread_management.html#thread.thread_management.thread.nativehandle

这篇关于给boost线程命名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆