Re: reference counting.. continued..

From: Robert Watson (rwatson_at_freebsd.org)
Date: 06/12/04

  • Next message: John Polstra: "Re: RFC: API change for sema_timedwait"
    Date: Sat, 12 Jun 2004 15:33:56 -0400 (EDT)
    To: Poul-Henning Kamp <phk@phk.freebsd.dk>
    
    

    On Wed, 9 Jun 2004, Poul-Henning Kamp wrote:

    > I am not in favour of a dedicated API for refcounts.
    >
    > A dedicated API works if the refcount is a detached property of the
    > object, and that is not normally the case outside OO+GC implementations.
    >
    > Our reference counts will almost invariably be integral properties of
    > our objects and therefore has to interact with the remaining object
    > locking.

    I don't have a strong feeling about the general need for a refcount API,
    but I can confirm that many of the interesting objects in the kernel
    wouldn't lend themselves to such an API. There are many cases where we'll
    want to protect the reference count using an existing lock, in which case
    locking built into the reference count API becomes a liability. Socket
    reference counting is one example of this: in some ways, it's a general
    purpose reference count, but the GC behavior is specific to sockets and
    depends on additional uncounted references from file descriptors and the
    prototocol layer.

    That said, I think making sure people get reference counts right is
    important: at the very least, I think it would be useful to have a
    refcount(9) man page with a well thought out example of a simple reference
    count implementation, or a pointer at such an implementation (ucred isn't
    bad).

    Robert N M Watson FreeBSD Core Team, TrustedBSD Projects
    robert@fledge.watson.org Senior Research Scientist, McAfee Research

    _______________________________________________
    freebsd-arch@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-arch
    To unsubscribe, send any mail to "freebsd-arch-unsubscribe@freebsd.org"


  • Next message: John Polstra: "Re: RFC: API change for sema_timedwait"

    Relevant Pages

    • Re: reference counting.. continued..
      ... >> I am not in favour of a dedicated API for refcounts. ... > I don't have a strong feeling about the general need for a refcount API, ... > want to protect the reference count using an existing lock, ...
      (freebsd-arch)
    • Implementing expected core OS functionality
      ... Most documentation and sample code on Windows ... Dolphin provides a wonderful platform for studying the OS API ... might reference the particular API. ...
      (comp.lang.smalltalk.dolphin)
    • Re: Determine if an item in a collection has changed
      ... What people do with API - I don't know. ... >> parent, which by necessity holds a reference to each of its children (via ... >> hold its pointer. ...
      (microsoft.public.vb.general.discussion)
    • Re: Framebuffer programming
      ... > Please give me the exact link so I may see that the correct URL is ... The new site does not appear to have an API ... >> reference. ... Since my knowledge of the framebuffer is currently ...
      (comp.os.linux.development.apps)
    • Re: c-extension crashes unexpected
      ... >i believe that has something todo with reference counts and memory ... int PyList_SetItem(PyObject *list, int index, PyObject *item) ... Python C API. ... Look at the C code that Pyrex generates, ...
      (comp.lang.python)