public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Roland McGrath <roland@redhat.com>
To: davidm@hpl.hp.com
Cc: GNU libc hackers <libc-hacker@sources.redhat.com>
Subject: Re: enabling caching for dl_iterate_phdr()
Date: Sat, 17 Jan 2004 00:57:00 -0000	[thread overview]
Message-ID: <200401170057.i0H0vQag022225@magilla.sf.frob.com> (raw)
In-Reply-To: David Mosberger's message of  Monday, 12 January 2004 14:56:27 -0800 <16387.9755.753294.37588@napali.hpl.hp.com>

>   >> Would it be possible to add two atomic counters,
>   >> dl_load_additions and dl_load_removals, which would get
>   >> incremented whenever something is a phdr is added to/removed from
>   >> the list that is traversed by dl_iterate_phdr()?
> 
>   Roland> What interface do you propose for exposing such counters?
>   Roland> We won't be adding any published interfaces using variables.
> 
> I think that's OK.  Do you think it would be OK to add a function
> which returns the address of one of several "atomic counter" variables?

That is a reasonable kind of interface in general.  The trouble here is
that glibc does not have any exported interfaces using atomic counters.
The right type to use for these is machine-dependent; `int' is not the
proper thing to be using in the interface.  The types used in atomic.h are
fine, but that is not an exported interface.  We don't want to export it in
that form.  Unless you want to wait for that, this seems like a blocker for
that style of interface.

>   enum {
> 	AC_DL_LOAD_ADDITIONS,
> 	AC_DL_LOAD_REMOVALS
>   } libc_atomic_counter_t;

For an exported interface using a parameter like this does not seem like
the best plan to me.  If new flavors are added, this is not well-expressed
for ABI compatibility.  To me, the simplest way to do compatibility issues
right is to use single-purpose entrypoints with separate names so symbol
versioning will just take care of it.  So, add a single entrypoint
specifically for these two counters now.  If you change it in the future,
you can add entrypoints or change the old entrypoint signature under the
same name using symbol versioning.

> In any case, if a callback-based approach is preferred, I can live
> with that, too.

I don't claim it's the best interface.  But that is the approach that
doesn't have other blocking issues right now.

       reply	other threads:[~2004-01-17  0:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <16387.9755.753294.37588@napali.hpl.hp.com>
2004-01-17  0:57 ` Roland McGrath [this message]
2004-01-17  1:39   ` Jakub Jelinek
2004-01-17  1:40     ` Roland McGrath
2004-01-17  1:51     ` David Mosberger
2004-01-22  0:35     ` David Mosberger
2004-01-22  8:39       ` Jakub Jelinek
2004-01-24  5:54         ` David Mosberger
2004-01-24 20:27           ` Ulrich Drepper
2004-01-26 21:48             ` David Mosberger
2004-01-26 22:39               ` Ulrich Drepper
2004-01-26 22:58                 ` Roland McGrath
2004-01-26 23:03                 ` David Mosberger
2003-12-16 19:55 David Mosberger
2003-12-23 22:24 ` Roland McGrath

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200401170057.i0H0vQag022225@magilla.sf.frob.com \
    --to=roland@redhat.com \
    --cc=davidm@hpl.hp.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).