Thanks, this was very helpful. Adding this as an optional feature (ReaderParameters) would be nice, but I can live with using a patched Cecil version.
Daniel On 2/16/2011 00:54, Jb Evain wrote: > On Tue, Feb 15, 2011 at 10:10 PM, Jb Evain <[email protected]> wrote: >> That seems painful. We can try to add one lock in >> ModuleDefinition.Read(Func<>) > For instance: > > readonly object module_lock = new object (); > > internal TRet Read<TItem, TRet> (TItem item, Func<TItem, > MetadataReader, TRet> read) > { > lock (module_lock) { > var position = reader.position; > var context = reader.context; > > var ret = read (item, reader); > > reader.position = position; > reader.context = context; > > return ret; > } > } > > Makes it easy to read from a module in different threads. But it does > have a perf overhead. Maybe this should simply be a ReadParameters, > well, parameter. > > Jb
signature.asc
Description: OpenPGP digital signature
