cvs commit: src/sys/kern kern_proc.c

Bosko Milekic bmilekic at FreeBSD.org
Wed Jun 9 18:07:28 GMT 2004


Julian Elischer wrote:
>As I've said before and will continue to say..
>"We need a more formal model of dealing with reference counts"
>
>i.e.
>
>we should get a set of reference counting primatives and make it WELL
>DOCUMENTED as to how they should be used..
>
>Referenc counting is something that you can't do "a bit". It's like
>being pregnant.. either you ARE reference counting, or you are doing
>something else. You can't count just "SOME" of the references..

  While this idea is initially appealing, you should be aware that
  it is not as straight-forward as it sounds.

  Namely, it is sometimes more advantageous to protect the manipulation
  of the reference count within a section of code already protected by
  an appropriate object mutex, and other times (in the absence of a mutex),
  it might be more advantageous to use atomic ops (no need for a mutex,
  slightly less costly per-instance).  So defining an API that does one
  OR the other might not always be appropriate.

  -Bosko
 


More information about the cvs-src mailing list