3 ms·
That's because parallelism is an optimization, not a programming abstraction. You might as well ask why function calls and inlined function calls don't have dif
by eikenberry 11y ago
That's because parallelism is an optimization, not a programming abstraction. You might as well ask why function calls and inlined function calls don't have different statements. They certainly can (eg. C's inline keyword) but it is not necessary nor that important to inlining as an optimization.
- ruggeri 11y agoOne difference is that inlining is a safe optimization in most contexts. Parallelizing a goroutine is not safe if the goroutine shares memory. Obviously that's not the default Go style, but sometimes sharing state is unavoidable. So that would be one point in favor of different syntax.