Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Differences between Copy on Write (COW) and counted reference

2 views
Skip to first unread message

mosfet

unread,
May 10, 2007, 5:15:23 AM5/10/07
to
Hi,

I read an article about COW implementation and issues in multithreaded
environments.
Then I found another article about counted reference and now I don't
understand anything. For instance CString on windows use counted
reference but it seems it's different from COW.

Joe Seigh

unread,
May 10, 2007, 6:13:59 AM5/10/07
to

COW is a reader/writer solution. Reference counting is a storage
management technique used to keep track of the old copies of an
object. You could use GC or something else instead of reference
counting.

--
Joe Seigh

When you get lemons, you make lemonade.
When you get hardware, you make software.

Juha Nieminen

unread,
May 10, 2007, 6:23:39 AM5/10/07
to

AFAIK the only difference between reference-counting and COW is
that the latter is an extension of the former. In other words, COW
*is* reference-counted, but additionally if a non-const function is
called, it makes a deep copy of the data.

So if something uses COW, it uses reference-counting. Perhaps that's
what you read about CString? (Unless CString indeed doesn't make deep
copied if non-const functions are called...)

Chris Thomasson

unread,
May 11, 2007, 12:09:15 AM5/11/07
to
"mosfet" <john...@anonymous.org> wrote in message
news:4642e2ae$0$2334$426a...@news.free.fr...

> Hi,
>
> I read an article about COW implementation and issues in multithreaded
> environments.

COW is used in conjunction with some sort of lifetime management scheme. Its
just means that a full blown copy of an object is created in order to ensure
thread-safety wrt the reader/writers problem in general.

One should consider using PCOW instead... This is "Partial Copy-On-Write",
which usually turns out to be more efficient then the various COW
techniques; marked improvements wrt COW vs. PCOW can be realized most of the
time.


0 new messages