[Mono-dev] Setting and Getting Thread Priority

2016-06-07 Thread Neale Ferguson
After adding support for setting and getting thread priorities I’ve found
there’s one piece missing. Before a thread is started you can set its
priority such that when it’s started it will start with this priority
instead of the priority of the thread creating it.

At the moment the code lets this happen but does nothing with it. I have
started adding code to fix this missing piece. The trouble I am having is
that the wthreads.c implementation of GetThreadPriority() will simply
return THREAD_PRIORITY_NORMAL if the thread hasn’t been started yet: even
if a call to SetPriority has already been made. I was storing the priority
value in the MonoThread structure, however, wthreads.c does not have
visibility of this structure. I thought of putting it in MonoThreadInfo
but I’m not sure at which point this structure comes into existence. The
other place is within MonoThreadInternal which wthreads.c does see but
this requires a change in Threads.cs which has a one-to-one field
correspondence with the structure.

The other changes work fine such that a thread (running with the right
policy) will have its priority set at creation time. All that is missing
is GetPriority reporting the correct value before start time.

Neale

___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Loader Optimization with mono

2016-06-07 Thread Rafael Teixeira
AFAIR, multiple app-domains share things inside the same process.

It's like, for example, in ASP.NET where there are multiple web sites
running in the same web server (thus a single mono/.NET VM instance). If
you use web farming, or as is typical in ASP.NET Core start separate VMs
for each web app, there won't have any sharing of jitted code.

WIth multiple AppDomains in the same process, common code will be jitted
once and shared by all the applications, but beware that different versions
of core libraries will jit to different executable code, meaning possible
duplication of generated code.

As far as you spin multiple VMs these don't share code, for many reasons,
security ones being the top ranked.

Rafael Teixeira
O..:.)

On Tue, Jun 7, 2016 at 5:34 AM, techi eth  wrote:

> What is meaning of below query
> http://www.mono-project.com/docs/faq/technical/ Can Mono or .NET share
> system classes (loaded from mscore.dll and other libs) or will it behave
> like Sun’s Java VM?
>
> What you can do with mono is to load different applications in their own
> application domain: this is a feature of the CLR that allows sandboxing
> applications inside a single process space. This is usually exploited to
> compartmentalize different parts of the same app, but it can also be
> effectively used to reduce the startup and memory overhead. Using different
> appdomains the runtime representation of types and methods is shared across
> applications.
>
>
> what is the use of below option from mono.
> mono --list-opt
>
> shared Emit per-domain code
> sched  Instruction scheduling
>
>
> On Sat, Jun 4, 2016 at 1:29 AM, Rodrigo Kumpera  wrote:
>
>> Mono doesn't implement LoaderOptimization.
>>
>> On Thu, Jun 2, 2016 at 5:59 AM, techi eth  wrote:
>>
>>> Does  [LoaderOptimization(LoaderOptimization.MultiDomainHost)] work as
>>> desired on mono?
>>>
>>> I am using Mono 4.2 version on ubuntu  to test.
>>>
>>>
>>>
>>> I had following observation
>>>
>>>
>>>
>>> 1. Exe with this attribute and without this attribute take same memory.
>>> Even I had check shared memory also is same and residual - shared is also
>>> same .
>>>
>>> 2. Is there any tool on linux like Process explorer in windows to verify
>>> that all GAC assembly go to shares memory after this attribute is applied.
>>>
>>>
>>>
>>> ___
>>> Mono-devel-list mailing list
>>> Mono-devel-list@lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>>
>>>
>>
>
> ___
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>
>
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list


Re: [Mono-dev] Loader Optimization with mono

2016-06-07 Thread techi eth
What is meaning of below query
http://www.mono-project.com/docs/faq/technical/ Can Mono or .NET share
system classes (loaded from mscore.dll and other libs) or will it behave
like Sun’s Java VM?

What you can do with mono is to load different applications in their own
application domain: this is a feature of the CLR that allows sandboxing
applications inside a single process space. This is usually exploited to
compartmentalize different parts of the same app, but it can also be
effectively used to reduce the startup and memory overhead. Using different
appdomains the runtime representation of types and methods is shared across
applications.


what is the use of below option from mono.
mono --list-opt

shared Emit per-domain code
sched  Instruction scheduling


On Sat, Jun 4, 2016 at 1:29 AM, Rodrigo Kumpera  wrote:

> Mono doesn't implement LoaderOptimization.
>
> On Thu, Jun 2, 2016 at 5:59 AM, techi eth  wrote:
>
>> Does  [LoaderOptimization(LoaderOptimization.MultiDomainHost)] work as
>> desired on mono?
>>
>> I am using Mono 4.2 version on ubuntu  to test.
>>
>>
>>
>> I had following observation
>>
>>
>>
>> 1. Exe with this attribute and without this attribute take same memory.
>> Even I had check shared memory also is same and residual - shared is also
>> same .
>>
>> 2. Is there any tool on linux like Process explorer in windows to verify
>> that all GAC assembly go to shares memory after this attribute is applied.
>>
>>
>>
>> ___
>> Mono-devel-list mailing list
>> Mono-devel-list@lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>
>>
>
___
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list