腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
精选内容/技术社群/优惠产品,
尽在小程序
立即前往
文章
问答
(9999+)
视频
沙龙
1
回答
C++:
std
::异步和
std
::mutex导致
Linux
上的死锁,但运行在Windows上?
c++
、
linux
、
asynchronous
、
mutex
、
deadlock
我刚刚为
Linux
编译了一个在Windows下工作的项目,发现它挂在了某个点上。由于我使用的是
std
::异步和
std
::mutex,我的第一个假设是,这可能是一个死锁问题。_preprocessingActive) {
std
::
async
(
std
::launch::
async
, &BorderExtractor::preprocessImage, this, settin
浏览 4
提问于2015-01-16
得票数 3
回答已采纳
1
回答
为什么` `
std
::cout <<
std
::this_thread::get_id()‘不编译?
c++
、
c++11
、
cout
、
stdthread
、
thread-id
Wrapper wrap;
std
::
async
(
std
::launch::
async
, &Wrapper::consume, &wrap).get(); 而它
浏览 7
提问于2022-06-07
得票数 1
1
回答
来自windows xp中
std
::
async
的
std
::
async
c++
、
visual-c++
、
windows-xp
#include <iostream>#include <thread> int main() auto f1=
async
(launch::
async
, []()->int {
浏览 0
提问于2018-10-10
得票数 2
1
回答
std
::
async
与
std
::launch::
async
策略的行为
c++
、
multithreading
、
c++11
我对异步返回的
std
::launch::
async
策略和
std
::future对象的
std
::
async
函数的行为有一些疑问。
std
::this_thread::sleep_for(
std
::chrono::seconds(10));
std
::cout << "foo:done" <<
浏览 16
提问于2012-03-16
得票数 17
回答已采纳
1
回答
写入错误后,独立ASIO库在OSX和
Linux
系统上有不同的行为
c++
、
sockets
、
networking
、
boost-asio
、
asio
但在
linux
(Ubuntu18.04)上,在
async
_write操作完成并出现3次错误(对等设备重置连接或管道中断)之后,在下一次调用
async
_write之后将不再调用处理程序回调。<<
std
::endl; serverSocket.
async
_read_some(asio::buffer10) {
std
::this_thread::sleep_fo
浏览 4
提问于2020-03-03
得票数 0
2
回答
具有可变模板的C++异步无法找到正确的函数模板专门化
c++
、
templates
、
asynchronous
、
variadic-templates
async
(&test::rf, this,
std
::forward<Args>(args)...); return
std
::
async
(&test: error: no matching function for call to '
async
' return
std
::
async
(&test::rf, this, <e
浏览 0
提问于2015-06-29
得票数 1
2
回答
linux
下的gcc 4.7中的
std
::
async
会被破坏吗?
c++
、
asynchronous
、
c++11
、
pthreads
、
gcc4.7
在实际代码中使用
std
::
async
之前,我正在隔离测试它,以验证它在我的平台(它是ubuntu12.1064位)上是否正常工作。{ [&]() auto asy =
std
::
async
(
std
::launch::
async
, [](){}); });
浏览 3
提问于2013-04-06
得票数 5
回答已采纳
2
回答
std
::
async
未使用
std
::launch::
async
策略启动新线程
c++
、
multithreading
、
asynchronous
、
c++11
、
threadpool
如果我使用
std
:: launch ::
async
策略启动
std
::
async
,它不应该在新线程中启动每个异步任务吗?目前看来,新的异步任务将移动到刚刚完成其工作的线程中。从输出中可以看出,当使用
std
::
async
启动新的工作线程(例如,一个工作进程多次获得ID为34500的线程)时,它将在之前完成的线程中启动。我对
std
::
async
的理解是错误的,还是有一个底层的工作窃取队列或类似的东西?
浏览 2
提问于2012-07-14
得票数 4
回答已采纳
2
回答
std
::
async
参数太多
c++
、
asynchronous
、
arguments
、
future
好的,我试图在一个项目中使用
std
::future,但是我使用的
std
::
async
总是告诉我有太多的参数。::future<int> FN1 =
std
::
async
(
std
::launch::
async
, F, 1, 2, 3);
std
::future<int> FN2 =
std
::
async
(
std
::launch::
async
, F, 1
浏览 67
提问于2020-03-19
得票数 1
回答已采纳
1
回答
std
::
async
与线程
c++
、
multithreading
、
stdasync
我正在尝试理解
async
与使用线程到底有什么不同。在概念层面上,我认为多线程在定义上是异步的,因为您正在进行I/O之类的线程之间的上下文切换。但似乎即使对于单线程应用程序这样的实例,添加线程也与使用
async
是相同的。例如:#include <future> //
std
::
async
,
std
::future
浏览 5
提问于2021-03-26
得票数 3
1
回答
为什么boost服务器类抛出运行时错误?
c++
、
boost-asio
v4(), port)) do_accept(); void do_accept() acceptor_.
async
_acceptec)
std
::make_shared<session>(
std
::move(socket))->start();
浏览 37
提问于2022-01-25
得票数 3
回答已采纳
1
回答
io_context.run()返回得太早
api
、
c++11
、
boost
、
boost-asio
、
boost-beast
<typename CompletionToken> void(), token,
std
::ref(resolver),
浏览 4
提问于2020-11-02
得票数 1
1
回答
c++未解析标识符的未来
c++
这是我的教程代码:#include <iostream> //
std
::coutbool is_prime (int x) { <em
浏览 0
提问于2018-09-08
得票数 1
回答已采纳
2
回答
Visual 2013(Windows8.1)和GCC 4.9(Ubuntu14.10)异步的不同行为
c++
、
linux
、
multithreading
、
c++11
、
gcc
在Windows和
Linux
g++中,异步具有不同的行为(实现)。throw runtime_error("An expected exception");} try{ auto f2 =
async
(launch::
async
, Func2); f2.get();//block her
浏览 3
提问于2015-06-07
得票数 3
回答已采纳
1
回答
如何完成
std
::
async
c++
下面是一个示例代码:{ { {//do something }); { }
std
::a
浏览 0
提问于2018-01-21
得票数 0
1
回答
转发到
std
::
async
c++
、
c++11
, int>::*)(int&), CallbackAsyncTask<int, int>* const, int)’
std
::
async
(
std
::launch::
async
,
std
>::type>
std
::
async
(
std
::launch, _Fn&&, _Args&& ...)>::type>
std
::
async
浏览 20
提问于2020-03-29
得票数 0
回答已采纳
2
回答
通过信号中断睡眠
c++
、
linux
、
c++17
、
system-calls
、
usleep
我想编写一个应该等待
linux
信号(毫秒分辨率)的C++程序,但我无法找到实现这一目标的可能性。 auto f =
std
::
async
(
std
::launch::
async
, [&] { //
std
::this_thread::sleep_for(1s);
浏览 5
提问于2020-10-23
得票数 1
回答已采纳
1
回答
基于C++11的boost asio异步读取程序
c++11
、
boost-asio
在我的项目最近的开发中,我使用了
std
::future和
async
_read_some,这样调用者(比如用户线程)就可以在异步I/O上等待特定的持续时间,并且看起来像一个同步过程。但是,为了获取
std
::未来对象的调用,
async
_read_some函数永远不会返回,以防远程连接的对等点破坏。异步操作中的系统错误似乎根本不像声明的那样传播。
std
::future<size_t> result=socket.
async
_read_some(boost::asio::b
浏览 1
提问于2014-03-25
得票数 2
1
回答
对于并发队列示例来说,Helgrind是否正确工作?
c++
、
concurrency
、
valgrind
(
std
::launch::
async
, reader); auto w =
async
(
std
::launch::
async
, writer); w.wait();当我运行这段代码时,我得到了这些信息。
std
::basic_ostream<char,
std
::
浏览 9
提问于2022-03-27
得票数 0
回答已采纳
1
回答
为什么CPP异步代码会产生错误,但是没有异步的函数工作得很好呢?
c++
、
asynchronous
下面的代码给出了以下错误,但是没有线程和异步的函数工作得很好:你能告诉我错误的来源吗?<iostream>#include &
浏览 2
提问于2020-08-10
得票数 0
回答已采纳
点击加载更多
扫码
添加站长 进交流群
领取专属
10元无门槛券
手把手带您无忧上云
相关
资讯
【Rust日报】2021-01-16 Async-std v1.9.0 发布
【大家的项目】socks5-rs 一个使用async-std的异步socks5 server实现
【Rust每周一库】smol-异步rumtime
C+11线程thread与任务async
Script标签的async和defer
热门
标签
更多标签
云服务器
即时通信 IM
ICP备案
对象存储
实时音视频
活动推荐
运营活动
广告
关闭
领券