Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
假设我们有任务 1-8,我们有 2 个线程。任务 1-4 分配给线程 1,任务 5-8 分配给线程 2。可以分配执行顺序,例如,在开始任务 2 之前完成任务 1,任务 2 将根据任务的输出执行1 对于线程中的任务?
没有。Java 流并行功能以一种非常特殊的方式发挥作用,这赋予了它完全的控制权,特别是要求它可以决定如何执行操作以及以什么顺序执行操作。