News for hackers. Stuff that matters.
Re:Golang data structures by pcwalton on Saturday July 04, 2015 @02:54AM (#9829488)
You don't ever need a concurrent linked list or hash map?

Lock-free concurrent data structures always struck me as the killer use case for generics as far as data structures are concerned: reasoning about atomics (especially when you have to annotate with relaxed/acquire/release/sequentially consistent ordering) is really tricky and one small mistake will lead to incredibly difficult-to-reproduce bugs. You really don't want to rewrite those over and over. Even something like a j.u.c-style concurrent hash map with striped locking needs careful thought around growth and reallocation lest you deadlock; it's so much easier to just have someone else write the data structure.

Re:Golang data structures by threeseed on Saturday July 04, 2015 @03:26AM (#9829543)
Writing bug free data structure implementations is hard. Doing it in a way that is highly performant is extremely hard.

The idea of cutting/pasting code seems pretty backwards to me compared to just using one of these libraries:

http://java-performance.info/large-hashmap-overview-jdk-fast...

Re:Golang data structures by lolhackernews on Saturday July 04, 2015 @11:18AM (#9830394)
Thing is, in Go that library cannot be written generically.