caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* understanding weak
@ 2008-10-30 18:19 Warren Harris
  0 siblings, 0 replies; 9+ messages in thread
From: Warren Harris @ 2008-10-30 18:19 UTC (permalink / raw)
  To: caml-list caml-list

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]

I'd like to understand better how ocaml's weak pointers operate.  
First, although it doesn't seem to be specified in the documentation,  
I assume that weak pointers will *not* be reclaimed (e.g. from a weak  
hash table) if the program retains some other reference to the object.  
I.e. the weak pointer must be the last remaining pointer to the object  
for reclamation to occur.

My second question relates specifically to my application. I would  
like to have a primary cache of objects, and a secondary index into  
sub-objects referenced from the primary cache. I.e. CacheA references  
objects of type A; objects of type A reference objects of type B;  
CacheB references objects of type B. I would like to guarantee that  
weak references in CacheB are not flushed unless the corresponding  
reference from CacheA is first flushed. I assume will be the case if a  
non-weak reference from A to B is maintained. Can anyone verify?

Thanks,

Warren Harris
Metaweb Technologies


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 3739 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-11-01 15:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20081030182019.EEBC5BBB7@yquem.inria.fr>
2008-10-30 18:48 ` understanding weak CUOQ Pascal
2008-10-30 19:12   ` [Caml-list] " Daniel Bünzli
2008-10-30 19:35   ` Warren Harris
2008-10-30 23:06     ` Alain Frisch
2008-10-31  8:33       ` Rémi Vanicat
2008-11-01  1:08   ` [Caml-list] " Jon Harrop
2008-11-01 10:37     ` Stefano Zacchiroli
2008-11-01 15:18       ` kirillkh
2008-10-30 18:19 Warren Harris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).