Subj : Re: Lock Free -- where to start To : comp.programming.threads From : David Butenhof Date : Thu Sep 29 2005 01:21 pm David Hopwood wrote: > Joe Seigh wrote: >> Oliver S. wrote: >> >>> I think what David [Schwartz] means, is that lock-free is over-emphasized >>> and I must agree on that. With producer/consumer-patterns typical in server >>> -applications, intervals where queues are locked are extremely short >>> (in the best case only a pointer is fetched from a queue) and the >>> processing-intervals when a dequeued item is processed at least some >>> thousand times higher. So there's no real need for lock-free queues. >>> Lock-free lifo-pools may make sense for memory-allocators, but good >>> allocators magage thread-local pools so this need is minimized. And >>> if you need maximum performance on memory-allocation, you manage your >>> own pools. >>> Lock-free processing may look fascinating, but is primarily superfluous. >> So JSR-166 was a waste of time? > > Mostly, yes. ;-) Lock-free, like threads, like Perl, like emacs, like news, like so many other things, is an enormously powerful tool for certain things. And, yes, absolutely useless (or even worse) for many other things. Whether you're inclined to say that it's important (or relevant) for "95%" or "5%" of "real work" depends entirely on your personal definition of "real work"... which in turn depends on current position, experience, and training. As much as most programming today is pretty high level and abstract, it IS still valuable to understand how transistors work, and chip logic design, and memory busses and cache and pipelined instruction processing. When you're programming a parallel application, understanding what lock-free does and how it will affect your application contributes to your understanding of the memory model and implementation of your machine and application... and that can be powerful even if you don't actually use lock-free techniques. (But then, you probably do, even if you don't know it... and using them incorrectly can be dangerous.) -- Dave Butenhof, David.Butenhof@hp.com HP Utility Pricing software, POSIX thread consultant Manageability Solutions Lab (MSL), Hewlett-Packard Company 110 Spit Brook Road, ZK2/3-Q18, Nashua, NH 03062 .