In Computer Science, Roy diagrams are pictorial representations of the concurrency model describing the behavior of go-routines and channels. Roy diagrams give a simple visualisation of what would otherwise be a rather arcane and abstract program.
Sequential
Fundamentally, it begins with a pair of functions, which algorithms in it are to be executed sequentially. Communication between functions via a channel.
In diagram above, it is important to highlight that functions are arranged in sequential order, fn(i) executes before fn(i+1).
#channel #sequential #function
Concurrent
In Go, each concurrently executing activity is called a go-routine. In a concurrent program with two or more go-routines, calls to both functions can be active at the same time. In other words, order of executions is radically unknown.
When we go-ed the first function, its entire chain(sequential), started itself down to the last bit, are duplicated, and independently runs in parallel.
Example (cake shop)
Note that, 1 worker: 1 go-routine, n workers: n go-routines. Notice that for n workers: from ICING till the last process, INSCRIBE are duplicated and runs independently by number of n.
References
Repository below demonstrates concurrency modal in processes arranged in sequential order: bake -> ice ->inscribe.