Each has their own assembly resolver. I load each independently (this is occurring later calling a resolve where I am no longer thread per module but I figured things would be loaded at that point).
My guess is that they are not, and I need to lock myself at that point on module. On Thu, Dec 16, 2010 at 12:02 PM, Jb Evain <[email protected]> wrote: > Hi, > > It's missing the top of the stacktrace, so it's hard to say. > > First of all, are you sure that only one thread is accessing a module at a > time? > > Also, are you sharing one assembly resolver for all your modules? > > On Thu, Dec 16, 2010 at 5:57 PM, Greg Young <[email protected]> > wrote: > > When running with cecil code multi-threaded I occasionally get exceptions > > like the following > > " at Mono.Cecil.MetadataReader.ReadTypes() in > > S:\\cecil\\Mono.Cecil\\AssemblyReader.cs:line 679\r\n > > at Mono.Cecil.ModuleDefinition.<get_Types>b__8(ModuleDefinition _, > > MetadataReader reader) in S:\\cecil\\Mono.Cecil\\ModuleDefinition.cs:line > > 365\r\n > > at Mono.Cecil.ModuleDefinition.Read[TItem,TRet](TItem item, Func`3 > read) > > in S:\\cecil\\Mono.Cecil\\ModuleDefinition.cs:line 747\r\n > > at Mono.Cecil.ModuleDefinition.get_Types() in > > S:\\cecil\\Mono.Cecil\\ModuleDefinition.cs:line 365\r\n > > at Mono.Cecil.ModuleDefinition.GetType(String namespace, String name) > in > > S:\\cecil\\Mono.Cecil\\ModuleDefinition.cs:line 474\r\n > > at Mono.Cecil.MetadataResolver.GetType(ModuleDefinition module, > > TypeReference type) in S:\\cecil\\Mono.Cecil\\MetadataResolver.cs:line > > 74\r\n > > at Mono.Cecil.MetadataResolver.Resolve(IAssemblyResolver resolver, > > TypeReference type) in S:\\cecil\\Mono.Cecil\\MetadataResolver.cs:line > > 54\r\n > > at Mono.Cecil.ModuleDefinition.Resolve(TypeReference type) in > > S:\\cecil\\Mono.Cecil\\ModuleDefinition.cs:line 516\r\n > > at Mono.Cecil.TypeReference.Resolve() in > > S:\\cecil\\Mono.Cecil\\TypeReference.cs:line 251\r\n > > at > > > AssemblyChangeDetector.CouplingTestSearchStrategy.TryInterfacePrune(String > > fullName, Int32 depth, List`1 breadCrumbs, CouplingCacheNode > efferentEntry, > > TypeReference parentType, TypeDefinition definition) in > > > C:\\Users\\greg\\Desktop\\coupling\\AssemblyChangeDetector\\CouplingTestSearchStrategy.cs:line > > 180\r\n > > Do I need to grab a lock somewhere etc? > > -- > > Les erreurs de grammaire et de syntaxe ont été incluses pour m'assurer de > > votre attention > > > > -- > > -- > > mono-cecil > > -- > -- > mono-cecil -- Les erreurs de grammaire et de syntaxe ont été incluses pour m'assurer de votre attention -- -- mono-cecil
