3 ms·
'go' is PAR with different syntax (Everything after the 'go' line is implicitly one branch of the PAR) 'select' is ALT
by kolpa 8y ago
'go' is PAR with different syntax (Everything after the 'go' line is implicitly one branch of the PAR)
'select' is ALT
- zbobet2012 8y agoThat's correct apologies.
- mpweiher 8y agoHmmm...as far as I understood the FA, the point is exactly that 'go' is unlike PAR in important respects. 'go' is more like a goto, the new goroutine is spawned, without any scoping. PAR opens a scope where all the contained routines are executed in parallel, but all of these must have terminated before the statement after the PAR is executed. ?
- pdonis 8y ago> Everything after the 'go' line is implicitly one branch of the PAR No, it isn't, because Go doesn't do the italicized part: "Everything in a PAR block will run in parallel and all their outputs will be collected and fed as the input to the next SEQ."