S
Scott Meyers
Libraries of data structures designed to support concurrent operations and to
scale well with the number of threads are common, e.g., ConcurrentHashMap and
ConcurrentLinkedQueue in Java, ConcurrentQueue and ConcurrentBag in .NET,
concurrent_queue and concurrent_vector in TBB and PPL. If the comments in a
recent thread in comp.lang.c++ ( http://tinyurl.com/2ey8mta ) are
representative, however, there is considerable skepticism that such data
structures are useful and some concern that designs employing them are almost
certainly misguided. Considerable googling on my part has failed to turn up
examples of compelling use cases for these kinds of data structures, but I find
it hard to believe that the people at Sun, Microsoft, and Intel (among others)
have devoted so much effort to creating libraries of data structures for which
there is little use.
I'd be grateful if people could sketch compelling use cases for concurrent data
structures, ideally with examples of situations in which they have been
successfully employed. Such data structures need not be lock-free (e.g., they
might use fine-grained locking or lock striping), but they should be
substantially more scalable than a design based on locking an entire data
structure for each access.
Thanks,
Scott
scale well with the number of threads are common, e.g., ConcurrentHashMap and
ConcurrentLinkedQueue in Java, ConcurrentQueue and ConcurrentBag in .NET,
concurrent_queue and concurrent_vector in TBB and PPL. If the comments in a
recent thread in comp.lang.c++ ( http://tinyurl.com/2ey8mta ) are
representative, however, there is considerable skepticism that such data
structures are useful and some concern that designs employing them are almost
certainly misguided. Considerable googling on my part has failed to turn up
examples of compelling use cases for these kinds of data structures, but I find
it hard to believe that the people at Sun, Microsoft, and Intel (among others)
have devoted so much effort to creating libraries of data structures for which
there is little use.
I'd be grateful if people could sketch compelling use cases for concurrent data
structures, ideally with examples of situations in which they have been
successfully employed. Such data structures need not be lock-free (e.g., they
might use fine-grained locking or lock striping), but they should be
substantially more scalable than a design based on locking an entire data
structure for each access.
Thanks,
Scott