Comments (5)
@kekekeks could you please describe your scenarios?
from dotnet-framework-early-access.
Currently we have some kind of WeakEventManager implementation that needs to enumerate all event sources to compact event handler list for dead subscribers.
The reference graph looks somewhat like this:
static variable -> ConditionalWeakTable
of event sources -> SubscriptionList -> List<WeakReference>
of event subscribers.
When subscriber is collected there is no way to dispose the subscription list until event is triggered or event handler is added/removed unless ConditionalWeakTable supports IEnumerable. In case of .NET Core and Mono it does. We want to be able to use the code with the legacy .NET Framework.
from dotnet-framework-early-access.
Could you construct such a table using WeakReference alone?
cc @stephentoub
https://github.com/dotnet/corefx/issues/14387
from dotnet-framework-early-access.
ConditionalWeakTable
is more GC efficient since it uses DependentHandle: GC is aware that it can mark the the associated value as unused alongside with the key. Implementing a custom table with WeakReference as keys would cause more objects to survive through the collection and be promoted to the next GC generation which is not a desirable behaviour.
from dotnet-framework-early-access.
@kekekeks thanks for the suggestion. We have discussed this and do not plan to do the port. We do not believe the value and need is high enough to justify the cost and risk.
from dotnet-framework-early-access.
Related Issues (20)
- VisualStyleState return weird number HOT 6
- Windows Update Removes 4.8, installer thinks it's still there HOT 1
- SHA3 support HOT 4
- System.Windows.Forms.ListView HideSelection Default Value Incorrect HOT 5
- Merge ObjectIdGenerator Changes To 4.8 HOT 12
- Subtitle/Closed Caption HOT 1
- System.NullReferenceException in .net 4.8 AutomationPeer HOT 3
- Visual Studio crashes HOT 4
- Support Persian Calendar
- 4.8 release notes missing Vector2 fix
- Moving a WPF window upwards gets stuck and stops updating HOT 4
- Environment.SetEnvironmentVariable() messing up system variables and registry keys HOT 7
- missing fix from coreclr: Fiber-friendly Vectored Exception Handling #20746
- Screen of Death when moving some WPF windows between multiple monitors with different DPIs HOT 1
- .Net Framework 4.8 - bug when using System.Web.Caching HOT 11
- .NET 4.8 WPF UserControl Hosted in Winform - NullReferenceException HOT 8
- Failover Cluster Manager bug on Server 2019 after .NET 4.8 installed - unable to type more than two characters in to the IP fields
- NullReferenceException originating from a catch when expression results in an AccessViolation
- String.Replace bug
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnet-framework-early-access.