5 ms·
.NET calls this concept a 'dependent handle' if I understand you correctly, though allowing direct use of it is somewhat new: https://learn.microsoft.com/en-us
by kevingadd 3y ago
.NET calls this concept a 'dependent handle' if I understand you correctly, though allowing direct use of it is somewhat new:
https://learn.microsoft.com/en-us/dotnet/api/system.runtime.dependenthandle https://learn.microsoft.com/en-us/dotnet/api/system.runtime....
And there's an older API that wraps them which I've found quite handy:
https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.conditionalweaktable-2 https://learn.microsoft.com/en-us/dotnet/api/system.runtime....
Essentially, if you want to (externally - in code you wrote) associate two objects with each other without being able to modify the code of either of those objects, dependent handles are the ticket. It only creates a one-way liveness relationship, though, which may not be sufficient for every use case...