如何创建task_handle对象作为类的成员? [英] How do I create task_handle object as member of the class ?

查看:228
本文介绍了如何创建task_handle对象作为类的成员?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的软件中,我有一个for循环,它有非常繁重的过程,所以我想使用并行方法,如mask_task来并行运行这个for循环。

i需要创建任务句柄数组头文件然后使用它们是Cpp文件。

在MSDN中make_task的定义是本地的,返回值是'auto'所以我不能使用MSDN。



此命令现在在我的软件中运行:

In my Software i have a for loop which has very heavy process so i want to use parallel method such as mask_task to run this for loop in parallel .
i need to create array of task handle in Header file and then use them is Cpp file.
in MSDN the definition of make_task is local and the return value is 'auto' so i can not use the MSDN.

this command is now working in my software :

auto t1 = make_task([&]ParProcess(Input1,&Output1,&Output2);});





但我需要将't1'转换为类的成员和指针。

有人可以帮帮我吗?



but i need to convert 't1' to the member of class and a pointer.
Is anyone can help me ?

推荐答案

这篇关于如何创建task_handle对象作为类的成员?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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