monitors tend to have very low overhead so long as there is no
contention on them (atleast on the ms stack havnt benchmarked in mono
lately)

On Tue, Feb 15, 2011 at 6:54 PM, Jb Evain <[email protected]> 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
>
> --
> --
> mono-cecil



-- 
Les erreurs de grammaire et de syntaxe ont été incluses pour m'assurer
de votre attention

-- 
--
mono-cecil

Reply via email to