Event Loop and concurrency

I was reading this Parallelism and Concurrency with Temporal | Temporal.

Just wanted to clarify something based on this line Temporal’s SDKs always only run one thing at a time for a given Workflow, even when using ostensibly parallel things like [the Go SDK's workflow.Go()](https://pkg.go.dev/go.temporal.io/sdk@v1.24.0/workflow#Go).

If i have two different update handlers that are very simple, lets say just update the same variable in the workflow with different values then send a signal. There’s no risk of them running in concurrently right. One update should run, send a signal then the next update should run and send a signal, even if they were invoked in parallel

Sending a signal to another workflow is an async operation. So, the second handler will be invoked the moment the first one blocks on the send. You can use a different exclusion mechanism to guarantee that only one of them processes at a time.

1 Like