Compras Nikon Bluetooth |
This book begins with the evolution of the various libraries that support multithreading. In the ecumenical spirit of Unix, the authors cover all the bases of Portable Operating System Interface for Unix (POSIX) libraries, including Linux, DEC, IBM, HP, and Sun Solaris, and even add-ons to NT and OS/2 for their POSIX support. The authors acknowledge that there may be variations in your version of Unix, but suggest that POSIX threads have good support from most vendors.
The authors then cover the basics of threads and how they run in today's Unix. The authors turn quickly to their implementation in variants of Unix, including Lightweight Processes (LWPs). They then cover the lifecycles of threads and how they are scheduled.
The primary focus in Multithreaded Programming with Pthreads is on how to make threads work together effectively. Multithreading involves a host of design issues, from patterns of how to organize threading in a program (with models such as the Producer/Consumer or the Master/Slave) to how to coordinate work done by multiple threads with facilities such as mutexes, critical sections, semaphores, and more arcane solutions (such as monitors and spin locks). The authors guide the reader to all the possibilities here, including suggestions on program design.
The real-world focus here involves some sample code (in C), a quick tour of the issues in using Pthreads with other programming languages, and some excellent material on benchmarking multithreaded code. The authors' ideas on when to use and when to avoid Pthreads are also useful. Though Pthreads will not work everywhere, they have a lot of potential to enhance the performance of today's software. This technical--and quite engaging--text can show you if Pthreads are in the cards for your next Unix programming project.
The book covers far too much material, in far too small a depth, to be of any use to anyone. Since it's published by Sun Microsystems, whose main operating system is Solaris, I thought there might be a decent coverage of threads on Solaris, with less devoted to NT, Dec and whoever elses. But no, there is as much coverage on Solaris threads, as there is on any other. You could say it's a balanced coverage, but at such a depth to be useless to anyone really. If you need to know about threads on Windows, find a specific book. If you need to know about pthreads, find a better book on pthreads.
Just avoid this book. However Sun Microsystems, a respected producer of hardware and some excellent technical books, published such rubbish I don't know.
Do youself a favor, take a look at 'Multithreaded, Parallel and Distributed Programming' by Gregory R. Andrews. That is a good book on parallel programming, with an indepth discussion about algorithms, and code to implement them in threads, openMP and MPI. It's coverage of algorithms, barriers, locks etc is excellent.
What's really interesting about the book is the authors' ``don't do that'' style. Another reviewer found this style to be bad. I found it highly helpful. Instead of presenting a single solution for a problem (``The One and Only True Solution''), and leaving the reader wondering about alternative solutions, they go on to explain what's wrong with these other solutions. People learn by making mistakes, and the authors point out lots of mistakes that can be avoided. This is an invaluable feature, not a bug.
This book is akin to learning French by teaching some basic grammar, some advanced grammar, and then shouting: "Je ne sais pas!" "Je voudrais un peu cherise!" without telling you what these mean...and leaving you clueless as to how to find out about them.
The book also spent every other paragraph covering problematic features of threads. If I were going to write a handbook for first time handgun owners, I wouldn't spend half the book explaining how you could take a live round, put it in the chamber, pull back the trigger, put the barrell in your mouth, and gently squeeze the trigger, oh by the way "Don't do that!" I would like to have seen a simple explanation of how to properly use threads for several different cases, and let natural selection determine if I was stupid enough to try some of the extreme cases that the book covers in detail.
Perhaps if the Win32, OS/2, and problematic features of threads had been separated out into late chapters, the book would have been readable. As the book is written, I found it hard to maintain a continuous stream of thought with the authors constantly bleating, Touret-like, "You can do this. BUT DON'T DO THAT! And here's how you can do the same thing for Win32. BUT DON'T DO THAT!" The confusing graphic illustrations and lack of substantial code examples concurrent with the topic at hand did not serve to make my reading any easier.
I also did not appreciate the authors' flippant dismissal of real time programming. To paraphrase the book, "We don't know real time, so tough cookie."
Overall, the book was a decent threads primer with good information scattered throughout.
The first rule of all intelligent tinkering is to keep all the parts.
-- Aldo Leopold, quoted in Donald Wurster's "Nature's Economy"
"Boy, life takes a long time to live."
-- Steven Wright