tall-needle-56640
12/20/2020, 7:08 AMpulumi.RunWithContext()
can be run concurrently because it is not called within a lock. Is that desired? Or is all this concurrent code just to protect the state?
NOTE: I am trying to port this code to C#lemon-agent-27707
12/20/2020, 6:19 PMlanguageRuntimeServer
and passes its address to the engine via the CLI. The server waits for the engine to call the Run gRPC method. The server has a lock to make sure that the engine doesn't try to start two concurrent updates on the server (could be a retry, guarding against future implementation changes).tall-needle-56640
12/21/2020, 4:11 PMThread A entersRun()
Thread A gets the lock, sets the state fromtowaiting
, and releases the lockrunning
Thread A callsRunWithContext()
Thread B entersRun()
Thread B gets the lock, sets the state fromtorunning
, and releases the lockrunning
Thread B calls// Current updates!RunWithContext()
Thread A gets the lock, sets the state fromtorunning
, and releases the lockfinished
Thread B gets the lock, sets the state fromtofinished
, and releases the lockfinished
lemon-agent-27707
12/21/2020, 4:27 PM