Skip to content

Commit 9ba5be5

Browse files
JanKrivanekfilmor
authored andcommitted
Added inline comment about dangers of multidomain usage
As requested here: #538 (comment)
1 parent 6488c2a commit 9ba5be5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/runtime/assemblymanager.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@ internal class AssemblyManager
1717
{
1818
// modified from event handlers below, potentially triggered from different .NET threads
1919
// therefore this should be a ConcurrentDictionary
20+
//
21+
// WARNING: Dangerous if cross-app domain usage is ever supported
22+
// Reusing the dictionary with assemblies accross multiple initializations is problematic.
23+
// Loading happens from CurrentDomain (see line 53). And if the first call is from AppDomain that is later unloaded,
24+
// than it can end up referring to assemblies that are already unloaded (default behavior after unload appDomain -
25+
// unless LoaderOptimization.MultiDomain is used);
26+
// So for multidomain support it is better to have the dict. recreated for each app-domain initialization
2027
private static ConcurrentDictionary<string, ConcurrentDictionary<Assembly, string>> namespaces =
2128
new ConcurrentDictionary<string, ConcurrentDictionary<Assembly, string>>();
2229
//private static Dictionary<string, Dictionary<string, string>> generics;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy