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

-- 
--
mono-cecil

Reply via email to