[Gc] gc7.0alpha1 and atomic_ops-0.6

Boehm, Hans hans.boehm at hp.com
Mon Nov 15 10:49:05 PST 2004


You need atomic_ops for either incremental GC or thread support.
If you need neither of those, you might be able to get it to build
without those, though it probably requires a bit of work to
make that happen.

I haven't tried this either, but in theory atomic_ops should build
on an unsupported platform.  And if you define AO_USE_PTHREAD_DEFS,
you should get pthread_mutex-based emulations of the atomic operations,
which might be good enough to get you started.  (Without
AO_USE_PTHREAD_DEFS, no interesting operations will be available.)

A minimal port of atomic_ops typically is not that hard either.  If
you're using gcc, you need to add an atomic_ops/sysdeps/gcc/<arch>.h
file, typically by cloning an existing one for a machine with similar
memory ordering semantics, and adding the few lines
of assembly to at least define AO_compare_and_swap_full.  You then
need to add the appropriate #if clause to atomic_ops.h.  If you define
AO_compare_and_swap_full, most of the other primitives will be
derived from that.  To get optimal code, you need a bit more work.  But this
should typically get you reasonably close for the GC.

(Older versions of the GC had similar but uglier code in gc_locks.h.)

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com
> [mailto:gc-bounces at napali.hpl.hp.com]On Behalf Of Peter Colson
> Sent: Sunday, November 14, 2004 5:28 PM
> To: gc at napali.hpl.hp.com
> Subject: [Gc] gc7.0alpha1 and atomic_ops-0.6
> 
> 
> What is the relationship of the atomic_ops package to the latest 
> version of the gc? Is it an absolute requirement to get the 
> gc package 
> working, at least to the point of making gctest run?
> 
> I ask, because I am trying to determine if there is a possibility of 
> porting the gc7 package to the LLP64 OS/400 platform and I am more 
> interested in seeing the results of gctest initially and directing my 
> energies towards that rather than porting atomic_ops to a new 
> platform.
> 
> It also seems that the atomic_ops package is a work-in-progress 
> (version 0.6) so I assume it will be undergoing a fair amount of 
> revision?
> 
> 
> Regards,
> Peter Colson.
> 
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 


More information about the Gc mailing list