Technology tips for IT executives
Boost your multiprocessing power
By Steven Gould
As users demand higher performance from their
applications and computers, your organization will require increased
parallel-computing capabilities.
In the simplest case, outfitting individual machines
with dual processors will do the trick, offering a small-to-moderate
performance increase to many users as they perform day-to-day tasks. For
users running Windows NT, which supports multiple processors, one
processor can be allocated to run the main application while the second
processor is allocated to perform operating system tasks.
Adding second processors to existing network servers
will result in similar performance improvements. But to get to the best
performance out of a multiprocessor configuration, primary software
applications must be carefully designed and implemented in advance to take
advantage of the multiprocessor hardware.
The basics: Breaking down applications An
application that most effectively takes advantage of multiple processors
must be designed so that its different parts can run on different
processors. A crude approach would be to break the application down into
several small executable programs, allowing the operating system to run
the different executables on different processors. The best way to design
such an application, however, would be to break it down into several
"threads" of execution. Each thread could then execute independent of the
others. In this case, the program would have to be carefully designed in
such a way that all its threads could run at the same time without
interfering with each other.
Designing applications in this way has the advantage of
improved resource use—primarily as a result of lower memory and CPU
overhead— and results in more efficient code, and often faster execution.
Windows NT is able to assign a different CPU to each thread, thereby
allowing multithreaded applications to take advantage of multiprocessor
machines, as well as single-processor machines in a more limited way.
Single-threaded applications are not able to do this, and therefore do not
benefit from a multiprocessor machine.
Developers writing multithreaded applications encounter
several issues not found in single-threaded applications. For example, if
two threads of execution need to update the same piece of global data at
the same time, it is important that this update be synchronized to avoid
data corruption.
Preparing for multithreaded application
development If you manage the development of a multithreaded
application, it's important to ensure that your team has sufficient
training and experience.
Here are some tips to ensure a smooth
process:
Be sure to understand what parallel processing can and
cannot do Some applications aren't well-suited for parallel
processing. In such cases, your overall performance improvement may be
minimal. You may hope that doubling the number of processors will make
your application run twice as fast, but a performance improvement of 80 to
90 percent is more likely. In some rare cases, doubling the number of
processors will, in fact, result in the application running more than
twice as fast. When this happens, it's often referred to as a
"super-linear" performance improvement.
Carefully estimate the complexity of parallel
applications I've heard project managers say, "We don't do
multithreaded applications, because the technology is too difficult for
most developers to understand." If your team doesn't have
multithreaded-development experience, it's up to you to determine whether
the benefits of making your company's applications multithreaded outweigh
the cost of ensuring that your developers have the appropriate training
and experience.
Provide for adequate training It's important
to ensure that your entire development team has sufficient training in
multithreaded development, but don't send the whole team to the same
training course. Different team members will require different levels of
training. Less experienced developers with a good understanding of the
basic concepts behind multithreaded application development will be able
to learn a great deal from more experienced developers. Don't expect a
team of less experienced developers to return from a one-week training
course and immediately be 100 percent adept at writing multithreaded
applications. Some things are best learned from experience.
Make sure you have experienced architects on your
team Having trained your developers, remember that even your most
experienced team members, while they may know your business inside out,
still do not necessarily have hands-on experience developing large
multithreaded applications. Some team members may promote the benefits of
parallel computing because they've seen or heard various success stories;
some may promote it because they see its potential and wish to learn more
about it. You should keep in mind the fact that this technology is still
relatively new to many; even those developers who are very interested in
the technology may be inexperienced with it—which isn't to say they can't
learn.
For larger multithreaded application projects, bring in
experienced architects to work with key developers and help guide them
through the design process. Experienced architects will be able to provide
a robust, multithreaded design for your application and steer your team
away from potential problem areas.
By ensuring that your applications make effective use
of threads, you can begin to realize the benefits of multiprocessor
machines.
About the author: Steven Gould is a lead consultant
for Deloitte Consulting/DRT Systems (http://www.drtsystems.com) in Dallas,
TX. He is a Sun Certified Java Developer and Microsoft Certified Solution
Developer. Write to him at steven.gould@stevengould.org. |