简体   繁体   English

Windows 工作流 4 - 运行并行任务

[英]Windows Workflow 4 - Running Parallel Tasks

In our current Windows Workflow model, we intend to have 3 long running processes running at the same time.在我们当前的 Windows 工作流模型中,我们打算同时运行 3 个长时间运行的进程。 Each process is responsible for a long running operation (such as copying a file from Location A to Location B).每个进程负责一个长时间运行的操作(例如将文件从位置 A 复制到位置 B)。

From my knowledge, WF4 only "supports 1 thread".据我所知,WF4 只“支持 1 个线程”。 Is it possible to have 3 activities (each performing a long running operation such as copying files) running at the same time?是否可以同时运行 3 个活动(每个活动都执行长时间运行的操作,例如复制文件)? Or does this mean Workflow is not the right solution for me?或者这是否意味着 Workflow 对我来说不是正确的解决方案?

The WF4 threading model is that there is exactly one thread at a time active in a workflow instance so if you have 2 workflows running then the activities from each workflow run in different threads. WF4 线程模型是一个工作流实例中一次只有一个活动线程,因此如果您有 2 个工作流在运行,那么每个工作流的活动将在不同的线程中运行。 The activities within a single workflow are not necessarily using the same thread as each other but each activity is sequential.单个工作流中的活动不一定使用相同的线程,但每个活动都是顺序的。

The blog mentioned in Maartens post is the place to start. Maartens 帖子中提到的博客是开始的地方。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM