是否有用于调度依赖运行的java库(在依赖关系DAG中给出)?

时间:2023-01-20 17:28:26

I have a bunch of runnables I want to run in multiple threads and some depend on others to complete before they begin. I wrote a simple utility to do this, but is there a library that already provides this capability?

我有一堆runnables我想在多个线程中运行,有些依赖于其他人在开始之前完成。我写了一个简单的实用程序来执行此操作,但是是否有一个已经提供此功能的库?

2 个解决方案

#1


2  

You can use a CountDownLatch to coordinate the activites of threads

您可以使用CountDownLatch来协调线程的活动

#2


1  

"some depend on others to complete before they begin".

“有些人在开始之前就依赖别人来完成”。

I assume this means some tasks use results of other tasks as input arguments. If so, search for "java dataflow" or "java workflow".

我认为这意味着某些任务使用其他任务的结果作为输入参数。如果是,请搜索“java dataflow”或“java workflow”。

If input arguments for each task can be represented with a single sequential queue, this special kind of dataflow is known as "Actor model", so search for "java actor library or framework".

如果每个任务的输入参数可以用单个顺序队列表示,则这种特殊类型的数据流称为“Actor模型”,因此搜索“java actor库或框架”。

In particular, an opensource project of mine df4j supports both dataflow and actor styles.

特别是,我的一个开源项目df4j支持数据流和演员样式。

#1


2  

You can use a CountDownLatch to coordinate the activites of threads

您可以使用CountDownLatch来协调线程的活动

#2


1  

"some depend on others to complete before they begin".

“有些人在开始之前就依赖别人来完成”。

I assume this means some tasks use results of other tasks as input arguments. If so, search for "java dataflow" or "java workflow".

我认为这意味着某些任务使用其他任务的结果作为输入参数。如果是,请搜索“java dataflow”或“java workflow”。

If input arguments for each task can be represented with a single sequential queue, this special kind of dataflow is known as "Actor model", so search for "java actor library or framework".

如果每个任务的输入参数可以用单个顺序队列表示,则这种特殊类型的数据流称为“Actor模型”,因此搜索“java actor库或框架”。

In particular, an opensource project of mine df4j supports both dataflow and actor styles.

特别是,我的一个开源项目df4j支持数据流和演员样式。