Re: atomic reference counting primatives.
From: John Baldwin (jhb_at_FreeBSD.org)
Date: 05/21/04
- Previous message: John Baldwin: "Re: atomic reference counting primatives."
- In reply to: Julian Elischer: "atomic reference counting primatives."
- Next in thread: John Baldwin: "Re: atomic reference counting primatives."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: freebsd-arch@FreeBSD.org Date: Fri, 21 May 2004 10:02:02 -0400
On Thursday 20 May 2004 04:56 pm, Julian Elischer wrote:
> This has been raised before but I've come across uses for it again and
> again so I'm raising it again.
> JHB once posted some atomic referenc counting primatives. (Do you still
> have them John?)
> Alfred once said he had soem somewhere too, and other s have commentted
> on this before, but we still don't seem to have any.
I still have them. Part of the problem is that there are lots of different
reference counts that work in different ways, and if you try to come up with
a single all-singing, all-dancing ref count implementation it will be too
complicated to provide any benefit. What I do think might be useful might be
a simple refcount() API that is useful for objects that are immutable when
the refcount > 1 like ucred and are updated via COW. These type of objects
have a mutex that just protects a refcount and nothing else. Using a single
refcount op for those objects will cut the number of atomic ops in half.
-- John Baldwin <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org _______________________________________________ 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"
- Previous message: John Baldwin: "Re: atomic reference counting primatives."
- In reply to: Julian Elischer: "atomic reference counting primatives."
- Next in thread: John Baldwin: "Re: atomic reference counting primatives."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]