詹金斯中的并行阶段是不同的进程还是只是不同的线程?
Parallel stages in jenkins are different processes or only different threads?
当我在 JenkinsFile 中写这样的东西时:
node {
parallel (
phase1: { sh "./firstProgram" },
phase2: { sh "./secondProgram" }
)
}
jenkins 运行 它是作为不同的进程还是只是作为不同的线程?
workflow-cps
插件提供了 parallel
功能。以下是 plugin's page 的摘录,其中讨论了 parallel
的工作原理。
All program logic is run inside a “CPS VM thread”, which is just a Java thread pool that can run binary methods and figure out which continuation to do next. The parallel step uses “green threads” (also known as cooperative multitasking): it records logical thread (~ branch) names for various actions, but does not literally run them simultaneously. The program may seem to perform tasks concurrently, but only because most steps run asynchronously, while the VM thread is idle, and they may overlap in time. No Java thread is consumed except during the typically brief intervals when Groovy code is actually being run on the VM thread. The executor widget only displays an entry for the “flyweight” executor on the built-in node when the VM thread is busy; normally it is hidden.
当我在 JenkinsFile 中写这样的东西时:
node {
parallel (
phase1: { sh "./firstProgram" },
phase2: { sh "./secondProgram" }
)
}
jenkins 运行 它是作为不同的进程还是只是作为不同的线程?
workflow-cps
插件提供了 parallel
功能。以下是 plugin's page 的摘录,其中讨论了 parallel
的工作原理。
All program logic is run inside a “CPS VM thread”, which is just a Java thread pool that can run binary methods and figure out which continuation to do next. The parallel step uses “green threads” (also known as cooperative multitasking): it records logical thread (~ branch) names for various actions, but does not literally run them simultaneously. The program may seem to perform tasks concurrently, but only because most steps run asynchronously, while the VM thread is idle, and they may overlap in time. No Java thread is consumed except during the typically brief intervals when Groovy code is actually being run on the VM thread. The executor widget only displays an entry for the “flyweight” executor on the built-in node when the VM thread is busy; normally it is hidden.