DevOps / Gradle8 Interview Questions
How does Gradle support parallel task execution?
With org.gradle.parallel=true (or the --parallel flag), Gradle can execute tasks from different projects concurrently on separate worker threads, as long as the task graph shows no dependency relationship between them — two independent subprojects' compileJava tasks, for instance, have no reason to wait on each other.
# gradle.properties org.gradle.parallel=true org.gradle.workers.max=4
Parallelism here is at the project level by default — tasks within the same project still generally execute sequentially relative to each other, since they often share mutable state or are more likely to have implicit ordering dependencies. Separately, some individual task types (like the test task) can internally parallelize their own work, e.g. running test classes across multiple forked JVMs via maxParallelForks, which is a different, task-specific mechanism layered on top of the general project-level parallel execution setting.
More Related questions...
