guidelines for refcounting / cbdata

From: Robert Collins <robertc@dont-contact.us>
Date: 28 Jan 2003 12:08:37 +1100

Do these seem right?

*) Use cbdata for any asynchronous calls, where the caller may disappear
during the calls duration. I.e. calling a acl checklist from a http
request object. An alternative but more complex approach is to have
'backwards facing' refcounting, where the callee holds a reference to
the caller. Such a design needs more thought than cbdata, and cbdata is
advised unless it is insufficient for the needed behaviour.
*) Use refcounting where multiple objects may use a single object, and
no 'last user' can be guaranteed. I.e. refering to a specific acl entry
from a checklist.
*) Use both if needed following the programmer guide howto. I.e. a
shared resource (say store entry) that may pass itself to a async
callback object.

Rob

-- 
GPG key available at: <http://users.bigpond.net.au/robertc/keys.txt>.

Received on Mon Jan 27 2003 - 18:08:43 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:19:07 MST