(j3.2006) Question from a colleague

Robert Corbett Robert.Corbett
Tue Apr 7 15:36:07 EDT 2009


Van Snyder wrote:

> A colleague asked me whether there is a performance benefit if the
> compiler is informed that it is not necessary for a procedure to be
> thread safe.  This actually originated in a discussion of iterators in
> python, CLU and alphard, where the activation record has to be preserved
> between suspension and resumption, as for a coroutine.  My colleague did
> ask, however, whether our code would run faster if we could tell the
> compiler it didn't need to be thread safe.  We use 5 million cpu hours
> per year, so a little improvement makes a big difference.

At least with Sun Fortran, thread-safety is not an issue for the
compiler.  The run-time libraries are where thread-safety is an
issue.  The main areas affected by thread-safety are storage
allocation and deallocation and I/O.  I have seen programs that
are I/O intensive spend a surprisingly large percentage of their
time manipulating locks.

Bob Corbett



More information about the J3 mailing list