Version française
Home     About     Download     Resources     Contact us    
Browse thread
understanding weak
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Warren Harris <warren@m...>
Subject: understanding weak

--Apple-Mail-23-122959228
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed;
	delsp=yes
Content-Transfer-Encoding: 7bit

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


--Apple-Mail-23-122959228
Content-Disposition: attachment;
	filename=smime.p7s
Content-Type: application/pkcs7-signature;
	name=smime.p7s
Content-Transfer-Encoding: base64

MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIIKlzCCBREw
ggP5oAMCAQICAQEwDQYJKoZIhvcNAQEEBQAwgb8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxp
Zm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNpc2NvMSMwIQYDVQQKExpNZXRhd2ViIFRlY2hub2xv
Z2llcywgSW5jLjEbMBkGA1UECxMSTWV0YXdlYiBPcGVyYXRpb25zMSEwHwYDVQQDExhNZXRhd2Vi
IFJvb3QgQ2VydGlmaWNhdGUxHjAcBgkqhkiG9w0BCQEWD29wc0BtZXRhd2ViLmNvbTAeFw0wNjEw
MTcxNjAyNTRaFw0xNjEwMTQxNj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