New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PipeType::PARALLEL Parallel data access security #525
Comments
Hi ayongsir, could you provide a sample code so we can better understand the question? Thank you. |
ok,Thank you. Here is my understanding. I don't know if there are any mistakes, please advise me. The core logic of my code is as follows:
Regarding the third article, if tf:: PipeType is set to SERIAL, I understand it is safe because only the parallel of the pipeline, and the tasks within the same pipeline are serial But if tf:: PipeType is set to PARALLEL, in addition to the parallelism of the pipeline, there are also parallelization of individual tasks within the pipeline. Is there a way to access data in parallel without using locks? I thought about it for a moment. If the task supports parameters, such a problem would be relatively simple, such as the following:
The code I am currently using is as follows: class TaskFlow { inline void TaskFlow::AddData(const std::shared_ptr &frame) { bool_t TaskFlow::Init() { auto task1 = pipe_task_[0].emplace( static tf::Pipeline pipe_line_(
task_flow_->composed_of(pipe_line_); core_callback_ = & {
}; return true; void TaskFlow::Start() { void TaskFlow::Core() {
} |
I have an application that uses tf:: Pipeline to build a multi DAG task, and uses pf. token() to control the processing data of each task.
If the type of the tf:: Pipe task is set to PipeType:: SERIAL, then I will construct an array based on pf. pipe() to save data, which can safely access the concurrent data of the Pipeline.
However, if I set the type of the tf:: Pipe task to PipeType:: PARALLEL, how can I know the concurrent quantity of this tf:: Pipe task under the current data flow? Or how can I safely access data concurrently?
I think tf:: Taskflow task support parameter settings can solve this problem and be more flexible.
Is there a plan to support parameters for the tf:: Taskflow task?
Looking forward to a reply and thanking in advance!
The text was updated successfully, but these errors were encountered: