Paperback: 400 pages
Publisher: Addison-Wesley Professional (May 26, 1997)
Product Dimensions: 7.4 x 1 x 8.9 inches
Shipping Weight: 1.4 pounds (View shipping rates and policies)
Average Customer Review: 4.4 out of 5 stars See all reviews (27 customer reviews)
Best Sellers Rank: #595,819 in Books (See Top 100 in Books) #16 in Books > Computers & Technology > Programming > APIs & Operating Environments > Device Drivers #219 in Books > Computers & Technology > Operating Systems > Unix #637 in Books > Textbooks > Computer Science > Operating Systems
This book has got what you want to know about pthreads. If that was all it had, and it had that in the right order, then it would be perfect. Instead, this is a very frustrating book to read.Take 'mutexes' as an example. A useful explanation for a beginner might be as follows... (1) Where the word 'mutex' comes from (2) What a memory conflict is (3) How a mutex can avoid it (4) How it works (simplified) (5) Some good examples in programsOn page 6 we first meet a mutex in a bit about putchar - we turn 'putchar into a 'critical section' (unexplained) because 'putchar might lock a "putchar mutex" '.Don't bother trying to understand it. Next paragraph, we find 'the correct solution is to associate the mutex with the stream', so it was a bad idea in the first place. Oh.Two chapters later, on page 47, you get to know what a 'mutex' is. It's mutual exclusion using a special form of Edsger Dijkstra's semaphore, you dummy. Well, if you've read Edsger Dijkstra's 1968 paper, then you aren't likely to be reading this book, says I.Confused? Keep going. Finally on page 90, there is a neat tabular description of one thread reading a variable before the other one has written it, and how you can stop this with a mutex. Clear and simple, this should have been on page 6. The following section (marked "You may want to skip this explanation...") then describes the sorts of problem you get with real hardware - surely a 'must read' if you are going to do this sort of stuff.There is a noble tradition of giving a bad coding example in one chapter, so you can show how cleverly you can fix it in the next. Look at any Stroustrop book.