3 ms·
> lock free queues That may change. Lock free algorithms generate quite a lot of garbage [1] & the Go GC story is much better now than before. > the language
by eternalban 11y ago
> lock free queues
That may change. Lock free algorithms generate quite a lot of garbage [1] & the Go GC story is much better now than before.
> the language makes it very difficult to write libraries to support those use cases.
Not sure why you hold this view. Atomic op primitives are provided. Is the issue the syntactic white noise of using the unsafe mechanisms?
[1]: can't find the cite of Cliff Click addressing this point. Intuitively, consider that lock free algorithms trade space for time.
- kasey_junk 11y agoYour point about lock free algos generating garbage is true of some algos but not others. The disruptor (last I looked) was lock free and garbage free. Without starting a huge debate, lack of generics, makes writing collections (especially concurrent safe ones) a trade off between correctness of algorithm & type safety.
- eternalban 11y agoI was addressing the GP's map/queue. > .. generics .. It should be obvious by now that Go's IDE is the command line. So Go generate young wo/man :) But seriously, having recently switched to C11 from Go, I would take C's crappy pre-processor over poor man's metadata in comments approach of Go. [p.s. edit: in the sense that C11 actually has a far less painful way to achieve type-safe generic code.]