img
.
The economics of purchasing an SMP machine are pretty much the same as the economics of
purchasing any machine. There are some extra unknowns ("I have 600 different applications that I
run from time to time; how much faster will they all run? How much time will I save in a day?"),
but if we focus on the primary applications in use, we can get reasonable data upon which to make
our decisions. The basic question is, "If my applications run an average of N% faster on a dual-
CPU machine that costs M% more, is it worth it?"
Only you (or your customers) can answer this question, but we can give you some generalities.
Here is a typical situation: The customer's major application is MARC Analysis's MARC Solver
(for circuit simulation). The MARC Solver runs about 80% faster on a dual-processor
SPARCstationTM 20 than it does on a single-processor SPARCstation 20. The single-processor
machine costs $16,000; the dual-processor unit costs $18,000 (about 12% more). If the designers
(who cost at least $100,000/year) are constantly waiting for the solver to complete its runs, is it
worth it? Obviously, yes. You will save a lot of money on a minor investment. Indeed, MARC
sells very well on SMP machines.
If you are a program developer (either in-house or an ISV), your question is going to be, "Should I
spend the time to write my program so that it will take advantage of SMP machines?" (This
probably means threading, although there are other possibilities.) Your answer will be related to
your anticipated sales. If your program runs 50% faster on a dual-processor machine, will your
customers buy SMP machines and more of your software? Or, to pose the question differently, if
you don't do it, will some competitor do it instead and steal your customers?
The answer depends upon your program. If you write a simple text editor that is never CPU-bound,
the answer is a clear "no." If you write a database that is always CPU-bound, it's "yes." If you
write a page-layout program that is sometimes CPU-bound, the answer is "maybe." In general, if
users ever have to wait for your program, you should be looking at threading and SMP.
But there is more value to threading than just SMP performance. In many instances, uniprocessors
will also experience a significant performance improvement. And that bit about programming
paradigms? It really does count. Being able to write simpler, more readable code helps you in
almost all aspects of development. Your code can be less buggy, get out there faster, and be easier
to maintain.
Multithreading is not a magic bullet for all your ills,[1] and it does introduce a new set of
programming issues that must be mastered, but it goes a long way toward making your work
easier and your programs more efficient.
[1]
If you have ever spent days debugging complex signal handling code, you may disagree. For
asynchronous code, it is a magic bullet!
Search WWH :
Custom Search
Previous Page
Multithreaded Programming with JAVA - Topic Index
Next Page
Multithreaded Programming with JAVA - Bookmarks
Home