腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
文章/答案/技术大牛
搜索
搜索
关闭
发布
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
如何摆脱“
std
::WinAPI::id”与"WinAPI线程-id“(在Windows上)相同的id?
、
、
、
、
如何从
std
::thread::id
中
获得与"Win线程- id“相同的id(在Windows上)?::thread::id this_id =
std
::
this_thread
::
get_id
(); // OK (but internal only: _id) const auto threadId1 =
浏览 7
提问于2022-05-16
得票数 1
回答已采纳
1
回答
如何告诉
c++
并发运行库重用以前的线程以进行任务延续
、
、
、
我使用visual
c++
并发运行库创建了一个任务,然后对其进行了四个连续的调度。::cout <<
std
::
this_thread
::
get_id
() <<
std
::endl; .then([]
std
::cout <<
std
::
this_thread
::
get_id
() <<
std
::endl; })
浏览 6
提问于2015-05-21
得票数 4
2
回答
嵌套的co_ await /协程类似于C#的嵌套等待样式
、
、
然而,我发现在
c++
协程框架
中
很难做到这一点。+协程框架
中
(下面是我在
C++
中
失败的尝试),如
何在
调用"co_await Foo2()“之后恢复代码?**return_type gone
浏览 0
提问于2021-06-14
得票数 1
1
回答
对于不同的中断点,Boost::thread::interrupt()的行为是不同的。为什么?
、
、
、
在
打印
每个语句之前,都会
打印
线程id,这样我们就可以看到发生了什么。当用户按enter时,中断在主线程
中
调用,但在辅助线程
中
捕获。然后,该线程被销毁。然后主线程继续运行,程序退出。例如,在使用条件变量时,如
何在
worker函数
中
捕获中断?我在什么地方弄错了吗?)
std
::cout<< boost::
this_thread
::
get_id
() << " waitedCond
浏览 0
提问于2013-10-07
得票数 1
3
回答
C++
标准是否要求在主线程
中
执行静态变量的动态初始化?
、
、
C++
标准是否要求在调用main()的同一线程
中
执行非局部静态变量的动态初始化更具体地说,给定以下代码:#include <thread> static
std
::thread::id id =
std
::
this_thread</em
浏览 45
提问于2015-04-21
得票数 16
回答已采纳
1
回答
十进制值: cout << dec << boost::
this_thread
::
get_id
()
、
、
、
std
::cout <<
std
::showbase;我总是得到十六进制,例如0xdf08。
浏览 0
提问于2013-06-18
得票数 5
回答已采纳
3
回答
如
何在
c++
中将
std
::thread::id转换为string?
、
、
如
何在
C++
中将
std
::thread::id类型转换为字符串?我正在尝试将
std
::
this_thread
::
get_id
()生成的输出类型转换为字符串或字符数组。
浏览 11
提问于2013-10-09
得票数 24
回答已采纳
1
回答
线程
中
不一致的thread_local变量
、
、
::cout << "model " <<
std
::
this_thread
::
get_id
() << " " << &TRIALS::a << " " << TRIALS::a <<
std
::endl::cout << "worker " <<
std
::
this_thread
::
g
浏览 1
提问于2019-10-07
得票数 3
回答已采纳
2
回答
使用
std
::hash<
std
::thread::id>()(
std
::
this_thread
::
get_id
())
、
、
、
、
我目前正在努力让
C++
应用程序在Windows和Linux
中
编译,在一些调试过程
中
,我发现没有在Linux上编译gcc 4.8 (感谢这个中的评论为此建议的解决办法是使用:有人知道这些产品的产量是否相同吗
浏览 3
提问于2014-12-11
得票数 3
回答已采纳
2
回答
在
C++
中线程中有一个with循环的条件变量
、
我试图弄清楚如
何在
std
::condition_variable中使用
C++
实现一个“奇怪”的生产者和消费者程序,在这个程序
中
,我对count变量设置了一个限制。== 1; });
std
::cout <<
std
::
this_thread
::
get_id
() << " - " << count <<
std
::endl;count--
浏览 0
提问于2019-07-17
得票数 0
回答已采纳
1
回答
C++
std
::
this_thread
::
get_id
()传递给cout
、
、
当使用
std
::
this_thread
::
get_id
()编译器在CodeBlocks上使用c++11时,线程号从2开始。每次我运行下面的代码时,它都会
打印
线程2-6而不是0- 4。为什么?是否有可能在后台运行的其他
c++
应用程序正在使用线程ID 1和2?这是什么巫术?#include <iostream>#include <mutex>
std
::mu
浏览 2
提问于2017-10-10
得票数 0
回答已采纳
1
回答
C++
静态变量总是在主线程上销毁吗?
、
、
、
简短的问题:它们是否总是只在程序退出时被销毁(考虑到我们没有手动调用它们的析构函数)?为了简洁起见,让我们假设调用析构函数。(我们没有拔掉插头,我们没有杀死-9)
浏览 2
提问于2017-11-09
得票数 9
回答已采纳
2
回答
如
何在
C++
中
打印
std
::
this_thread
::
get_id
()?
、
因此,我不能仅仅指望
get_id
()在堆栈上保留一个4或8字节的值,然后简单地将该值
打印
为十六进制。
浏览 552
提问于2020-04-14
得票数 1
回答已采纳
2
回答
为什么程序不能在堆栈展开后达到适当的返回指令?
、
、
、
、
::exception{ Exception(
std
::string str){ throw Object::Exception ("Some error");}int main(){ Object instance;
浏览 1
提问于2020-05-02
得票数 2
回答已采纳
2
回答
this_thread
::
get_id
()是否总是随着每个新线程的启动而递增?
、
、
我可以通过以下方式
打印
线程ID来控制台:在此之后,
打印
到控制台的in对应于在Visual 2013 Community
中
可以找到的in:如果我按Debug -> Windows -> Thre
浏览 3
提问于2016-11-04
得票数 1
回答已采纳
2
回答
调用某个回调函数两次会导致分割错误: Nan
、
、
、
、
我正在编写
C++
插件,大多数情况下使用,使用调用异步回调。当我只调用一次回调时,它是完美的。但是,当我两次调用回调时,它就会给出Segmentation fault (core dumped)。console.log("result" + a);lib.HeaderExample.startThread();
C+
::cout << "running HandleOKCallback in thread " << <
浏览 10
提问于2017-08-09
得票数 3
回答已采纳
1
回答
用boost::asio::post在coroutine中切换上下文
、
、
、
、
我在试着理解
C++
的协同效应。我在下面的示例
中
的期望是,每个asio::post将将上下文/线程切换到给定的线程池。但有些很奇怪的事情发生了。boost::asio::use_awaitable);
std
::cout << "thread3: " << boost::
this_thread
::
get_id
() <<
std
::endl;
this_thread
::
get_id
() &
浏览 11
提问于2022-10-14
得票数 1
回答已采纳
1
回答
std
::
this_thread
::
get_id
()在VS2013
中
可靠吗?
、
、
、
标题什么都说:)#include <cstdio> { printf("thread id = %x\n",
std
::
this_thread
::
get_id
thread
浏览 4
提问于2014-03-06
得票数 2
回答已采纳
2
回答
具有C++20协同线的线程之间的切换
、
、
::jthread& out) {} int main(
浏览 6
提问于2022-05-10
得票数 0
回答已采纳
2
回答
打印
std
::
this_thread
::
get_id
()给出“线程::非执行线程的id”?
、
、
它过去工作得很好(然后外星人肯定黑了我的电脑):#include <iostream> {} 现在它
打印
thread::id of a non-executing thread。ideone.com
打印
了一些ID,但
浏览 11
提问于2016-04-01
得票数 9
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
热门
标签
更多标签
云服务器
ICP备案
云直播
对象存储
腾讯会议
活动推荐
运营活动
广告
关闭
领券