#How to achieve parallelism with go sdk?

1 messages · Page 1 of 1 (latest)

mental moat
#

Is there some function I'm missing in the reference to parallelize dag execution, or should I handle parallel execution directly using goroutines?

lunar mist
#

Assuming you mean concurrency (sorry to be pedantic) then yes you should use the concurrency features of your language: in the case of Go, goroutines. The Dagger engine supports concurrent calls correctly.

#

If your runner machine has multiple cpus/cores available, concurrent operations will be dispatched across them automatically - so you will get some parallelism automatically

#

In theory Dagger’s concurrency model allows even more parallelism automatically, for example balancing sessions across different machines, or even individual operations within a session. But that requires non-trivial engineering and is not yet supported