3 ms·
It's great for doing things like k-means clustering or Delaunay triangulation. Those might not come up a lot for you, but some people need to do them, and would
by pjscott 16y ago
It's great for doing things like k-means clustering or Delaunay triangulation. Those might not come up a lot for you, but some people need to do them, and would love to be able to speed that up by throwing several processor cores at the problem. Solving them on a cluster is a lot harder, and often unnecessary.
(On k-means clustering, in particular, Clojure-style transactional memory gives an almost linear speedup with the number of processor cores, without significantly changing the code. That's worth something.)
- kanak 16y agoCould you please provide a link to the implementation? I'm really interested in learning how this is done. Thanks.
- pjscott 16y agoSorry, I can't point to any code, but in both cases the approach is the same: you have some shared data structures, like an array of regions containing points, or a red-black tree, or a priority queue, and several threads all read and write these data structures. Since transactional memory lets you run concurrently unless there are actual memory conflicts, this often gives better concurrency than locks. Of course, for examples like these, the tricky part is designing data structures that don't have many inherent memory conflicts. Red-black trees, for example, are tricky because the rebalancing transformations tend to step on other threads' toes.