This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Atomic operations on the ARM


On Thu, Oct 03, 2002 at 11:20:01AM -0500, Benjamin Kosnik wrote:
> 
> > Oh, another question, why does the generic implementation not use a 
> > standard mutex from gthr.h?
> 
> these are supposed to be light-weight operations, seperate from the
> threading code.

Also a historical reason; IIRC, they were developed separately.
The threading/mutex routines were originally used for the STL subset, and
were thrown out in favor of the compiler's own gthr.h layer for simplicity
and correctness.  The atomicity.h stuff was written for the string class, in
order to do reference counting without going through a "heavy" mutex layer.

I don't think the two approaches overlap much even today, if at all.
I've occasionally thought about making the generic atomicity.h routines
call into the gthr.h layer, thus bringing them together and providing a
fallback atomicity header that is actually atomic, if terribly slow.


Phil

-- 
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
                                                 - Edsger Dijkstra, 1930-2002


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]