Ivan Maidanski | 4 Nov 2011 13:58
Picon

Re[2]: [Gc] weak maps and libgc

Hi Andy,

Look good to me. I've checked it into my working tree (and commit in several days I hope).
I've done one change to the proposed function - in case dest==src, it now returns success (instead of GC_DUPLICATE).

Also, I've added some tests regarding the function.

Regards.

26 10 2011, 20:18 Andy Wingo <wingo@...>:
> On Wed 26 Oct 2011 10:18, Ivan Maidanski <ivmai@...> writes:
> 
> >>  (2) a function to move disappearing links, perhaps callable only
> >>      within the alloc lock.
> >> 
> >>      I did some profiling today with the open-addressed table.  It has
> >>      to shuffle items around sometimes.  Unregistering then registering
> >>      disappearing links shows up pretty high on the profile.
> >
> > Is my understanding correct - you want to optimize the following:
> >
> > // assume GC_general_register_disappearing_link(&link, obj1);
> > ...
> > GC_unregister_disappearing_link(&link);
> > GC_general_register_disappearing_link(&link, obj2);
> >
> > Right? If yes, I don't mind again.
> 
> Patch attached.  WDYT?
> 
(Continue reading)

Boehm, Hans | 8 Nov 2011 02:23
Picon
Favicon

RE: Re[4]: weak maps and libgc

Sorry about the belated reply.  Again.

> -----Original Message-----
> From: Ivan Maidanski [mailto:ivmai@...]
> Sent: Wednesday, October 26, 2011 2:36 AM
> To: Boehm, Hans; Andy Wingo
> Cc: gc
> Subject: Re[4]: [Gc] weak maps and libgc
> 
> Hi Hans,
> 
> What's your opinion of these 3 ideas?
> 
> PS. Anyway, it won't go into 7.2 branch.
> 
> Regards.
> 
> 26 10 2011, 13:05 Andy Wingo <wingo@...>:
> > Thanks for the thoughts, Ivan!
> >
> > On Wed 26 Oct 2011 10:18, Ivan Maidanski <ivmai@...> writes:
> >
> > > 26 10 2011, 00:06 Andy Wingo <wingo@...>:
> > >>  (1) a variant of GC_register_disappearing_link that also
> > >>      incremented an `unsigned long' somewhere in memory
> > >
> > > You mean statistic counter, right?
> > > Good idea.
> >
> > Yes, but ideally one that can be associated with a particular memory
(Continue reading)

Ivan Maidanski | 8 Nov 2011 08:23
Picon

Re[6]: [Gc] weak maps and libgc

Hi Hans,

Regarding GC_move_disappearing_link: I pushed the code to master yesterday (finalize.c).
To care about app code size, I think it's better to move all disappearing-link-related functions to a
standalone .c file.
BTW: GC_move_disappearing_link(&link,&link) can be use to test whether link is registered.

Regards.

08 11 2011, 05:29 "Boehm, Hans" <hans.boehm@...>:
> Sorry about the belated reply.  Again.
> 
> > -----Original Message-----
> > From: Ivan Maidanski [mailto:ivmai@...]
> > Sent: Wednesday, October 26, 2011 2:36 AM
> > To: Boehm, Hans; Andy Wingo
> > Cc: gc
> > Subject: Re[4]: [Gc] weak maps and libgc
> >
> > Hi Hans,
> >
> > What's your opinion of these 3 ideas?
> >
> > PS. Anyway, it won't go into 7.2 branch.
> >
> > Regards.
> >
> > 26 10 2011, 13:05 Andy Wingo <wingo@...>:
> > > Thanks for the thoughts, Ivan!
> > >
(Continue reading)

Ivan Maidanski | 9 Nov 2011 11:56
Picon

Re[7]: [Gc] weak maps and libgc

Hi Hans and Andy,

08 11 2011, 11:23 Ivan Maidanski <ivmai@...>:
> Hi Hans,
> 
> Regarding GC_move_disappearing_link: I pushed the code to master yesterday (finalize.c).
> To care about app code size, I think it's better to move all disappearing-link-related functions to a
standalone .c file.

Sorry, I was wrong about this (as disappearing-link-related code is invoked from other parts of GC and
moving only its API functions to a standalone file would require to make some global vars non-static).

So, I've added a new macro to prohibit compilation of that function on demand -
GC_MOVE_DISAPPEARING_LINK_NOT_NEEDED (similar to JAVA_FINALIZATION_NOT_NEEDED).

Regards.

> BTW: GC_move_disappearing_link(&link,&link) can be use to test whether link is registered.
> 
> Regards.
> 
> 08 11 2011, 05:29 "Boehm, Hans" <hans.boehm@...>:
> > Sorry about the belated reply.  Again.
> >
> > > -----Original Message-----
> > > From: Ivan Maidanski [mailto:ivmai@...]
> > > Sent: Wednesday, October 26, 2011 2:36 AM
> > > To: Boehm, Hans; Andy Wingo
> > > Cc: gc
> > > Subject: Re[4]: [Gc] weak maps and libgc
(Continue reading)

Favicon

Why does ./configure check for g77?

Hi all,

Why does the configure script check for g77?  Is there fortran support
in the collector?

checking for g77... g77
checking whether we are using the GNU Fortran 77 compiler... yes
checking whether g77 accepts -g... yes

checking for g77 option to produce PIC... -fPIC
checking if g77 PIC flag -fPIC works... yes
checking if g77 static flag -static works... no
checking if g77 supports -c -o file.o... yes
checking whether the g77 linker (/usr/ccs/bin/ld) supports shared
libraries... yes

--

-- 
   Johann Oskarsson                http://www.2ndquadrant.com/    |[]
   PostgreSQL Development, 24x7 Support, Training and Services  --+--
                                                                  |
   Blog: http://my.opera.com/myrkraverk/blog/
Andy Wingo | 15 Nov 2011 11:38
Picon
Favicon

Re: Why does ./configure check for g77?

On Tue 15 Nov 2011 00:33, "Johann 'Myrkraverk' Oskarsson"
<johann@...> writes:

> Why does the configure script check for g77?  Is there fortran support
> in the collector?

Probably something related to libtool.  See "Tags" in the libtool
manual.

Andy
--

-- 
http://wingolog.org/
Ivan Maidanski | 16 Nov 2011 17:33
Picon

Re[3]: [Gc] [PATCH 2/2]: Hexagon atomic ops

Hi Linas,

Based on your implementation of CAS for Hexagon, I've created another CAS primitive equivalent to GCC
__sync_val_compare_and_swap one (see AO_fetch_compare_and_swap() in https://github.com/ivmai/libatomic_ops/blob/ao_val_cas/src/atomic_ops/sysdeps/gcc/hexagon.h).
But I have no opportunity to test the code.

Could you please test that code ("ao_val_cas" branch) for Hexagon?

git clone git://github.com/ivmai/libatomic_ops.git -b ao_val_cas
cd libatomic_ops; autoreconf -vif
./configure; make check

Thanks.

17 10 2011, 22:18 Ivan Maidanski <ivmai@...>:
> Hi Linas,
> 
> I've merged this into 'release' (v7.2) branch as well.
> 
> Regards.
> 
> 12 10 2011, 21:39 Linas Vepstas <linasvepstas@...>:
> > On 11 October 2011 00:26, Ivan Maidanski <ivmai@...> wrote:
> >
> > > I've committed it as patch 9136ee6 to libatomic_ops repo master branch with minor changes (in
particular, I've changed the words in the license to match that on other files - the sense should remain the
same as in the original file you sent but please check it).
> >
> > Looks reasonable. I had cut-n-pasted the license notice from some
> > other file in that directory, with the goal of making it compatible.
(Continue reading)

Ivan Maidanski | 16 Nov 2011 18:07
Picon

sync_val_compare_and_swap equivalent in libatomic_ops

Hi all,

I've added CAS primitive which returns old value instead of comparison result (the similar primitives in
GCC are __sync_val_compare_and_swap and __sync_bool_compare_and_swap, respectively). I've named
the primitive as AO_fetch_compare_and_swap.

I've added implementations for emulations, x86, x64, arm v6, Hexagon (not tested), ia64 (trivial but not
tested), ppc (not tested) targets.
Meanwhile, alpha, avr, m68k, mips, s390, sparc lack such CAS primitive for now (unless via emulation) - I'm
unable to do this without help from the community.

For some targets (e.g., ia64), old bool CAS primitives containing "return oldval_fetched ==
oldval_expected" statement are completely removed from "sysdeps" part as they are implemented in
generalize.h (and generalize-small.h).

The functionality is available in ao_val_cas branch for testing period.
For implementation details, see the differences from master branch - https://github.com/ivmai/libatomic_ops/compare/master...ao_val_cas

Tests for new CAS has been added, so please everyone is welcomed to participate in testing:

git clone git://github.com/ivmai/libatomic_ops.git -b ao_val_cas
cd libatomic_ops
autoreconf -vif
./configure
make check

Regards.
Ivan Maidanski | 16 Nov 2011 18:20
Picon

Re[2]: [Gc] Re: avr32 port patch (from Debian)

Hi Bradley,

Could you also please supply a CAS primitive returning old value (instead of the comparison result)?

I've added such primitive e.g., for x86, arm - as a reference, you could see AO_fetch_compare_and_swap() 
implementation in:
https://github.com/ivmai/libatomic_ops/blob/ao_val_cas/src/atomic_ops/sysdeps/generic_pthread.h
https://github.com/ivmai/libatomic_ops/blob/ao_val_cas/src/atomic_ops/sysdeps/gcc/arm.h
https://github.com/ivmai/libatomic_ops/blob/ao_val_cas/src/atomic_ops/sysdeps/gcc/x86.h

The code is currently available only in ao_val_cas feature branch:
git clone git://github.com/ivmai/libatomic_ops.git -b ao_val_cas

Thanks.

30 05 2010, 19:07 Ivan Maidanski <ivmai@...>:
> 
> Sun, 30 May 2010 16:26:27 +0200 Stefano Rivera <stefano@...>:
> 
> > Hi gc (2010.05.20_22:13:14_+0200)
> > > Debian has been carrying a patch porting libgc to avr32 since August
> > > 2009 [0], which as far as I know has never been forwarded to you.
> >
> > Whoops, looks like that patch was incomplete [0].
> >
> > Here's an updated version [1] from the Debian avr32 porter.
> 
> I've committed the patch with the following changes:
> 1. AO_compare_and_swap -> AO_compare_and_swap_full;
> 2. "unsigned long int" -> "long";
(Continue reading)

Linas Vepstas | 16 Nov 2011 18:34
Picon
Gravatar

Re: Re[3]: [PATCH 2/2]: Hexagon atomic ops

Hi,

On 16 November 2011 10:33, Ivan Maidanski <ivmai@...> wrote:
> Hi Linas,
>
> Based on your implementation of CAS for Hexagon, I've created another CAS primitive equivalent to GCC
__sync_val_compare_and_swap one (see AO_fetch_compare_and_swap() in https://github.com/ivmai/libatomic_ops/blob/ao_val_cas/src/atomic_ops/sysdeps/gcc/hexagon.h).
> But I have no opportunity to test the code.
>
> Could you please test that code ("ao_val_cas" branch) for Hexagon?
>
> git clone git://github.com/ivmai/libatomic_ops.git -b ao_val_cas
> cd libatomic_ops; autoreconf -vif
> ./configure; make check

Looks good to me; the last few lines are:

PASS: test_stack
Performing 1000 reversals of 1000 element lists in 10 threads
Testing AO_malloc/AO_free
Succeeded
PASS: test_malloc
==================
All 4 tests passed
==================

--linas

Gmane