Java Reference
In-Depth Information
a language and environment that you can trust to do the right thing if you have written the
right program. Java may not have the ultimate answer to writing with multiple threads, but it
has an answer that you can use to your advantage to deal with the new chips. That by itself
makes this one of the good parts.
[ 37 ] We will follow the chip makers and ignore all of the other things that impact performance, such as
memory bandwidth, network latency, and the like. In fact, the cost of getting data onto the chip through
the I/O pins, it can be argued, is the largest single factor in overall performance, and little has been done
to change that in the past many years. The main effect of making the CPU run faster, on this view, is to
allow more cycles to be burned while the chip stalls waiting for the data. But I digress….
[ 38 ] Subject, of course, to the stipulations in the previous footnote.
[ 39 ] Like many other terms in computer science, “thread” can mean different things in different contexts.
There are hardware threads, software threads, and complex relations between the two. I will not go into
the admittedly important distinctions between these uses of the term; you can get into the kind of trouble
talked about in this chapter using any form of threading and concurrency.
[ 40 ] At least they don't hold water with respect to the impact on the performance of the program. There
are other arguments, having to do with the ease of programming or ease of reading, that could (and al-
most certainly will) continue. But since those are matters of style and taste, they don't terminate, so I
will not try to rehearse them here.
[ 41 ] My personal favorite is still Andrew Birrell's An Introduction to Programming with Threads , ht-
tps:// , recently updated so that the examples are in a more
contemporary language, as well as An Introduction to Programming with C# Threads ,
andrew/papers/ThreadsCSharp.pdf . It is an indication of the complexity of this problem that the best pa-
per on the subject was originally written in 1989. We have not progressed very far with respect to this
problem in the last 30 years.
[ 42 ] Of which there are many. My favorite is Doug Lea's Concurrent Programming in Java (Addison
Wesley), but there are others that are also good.
Search WWH ::

Custom Search