Home All Groups Group Topic Archive Search About

CAS and performance

Author
29 Apr 2005 8:19 AM
Jack Wright
Dear All,
   I would like to clear some basic understanding of how CAS works.
This is my understanding:
   1. Client application will run with the default security policy.
   2. CAS not done for all functions.
   3. CAS is done only for a code that tries to access protected
resources like harddisk, sockets etc.
   4. Does SecurityManager.SecurityEnabled = false enhance the
performance of an application that does not access any protected
resources?
   5. Has the 2.0 version changed the way CAS works?


Please help...

TALIA
Many regards
Jack

Author
29 Apr 2005 12:15 PM
Nicole Calinoiu
"Jack Wright" <su***@volcanomail.com> wrote in message
news:8f556eeb.0504290019.2c61b9f1@posting.google.com...
> Dear All,
>   I would like to clear some basic understanding of how CAS works.
> This is my understanding:
>   1. Client application will run with the default security policy.

Not necessarily.  For starters, the CAS policy can be changed, so the
default policy may not be in effect.  In addition, assemblies can reject
permissions, so any given application might run with a lesser permission set
than might otherwise be granted under policy.  Permission grants may also be
affected by evidence or policy set at the appdomain level or by a CLR host.


>   2. CAS not done for all functions.

Unless this is a corollary of your #3 point, I'm not quite sure what you
mean by this.

>   3. CAS is done only for a code that tries to access protected
> resources like harddisk, sockets etc.

That's true more or less by definition.  i.e.: A resource is "protected" if
code must pass a CAS demand to get to it.  I suspect that what you're trying
to get at is that, in general, CAS demands are only applied when accessing
resources that might be abused by malicious code.


>   4. Does SecurityManager.SecurityEnabled = false enhance the
> performance of an application that does not access any protected
> resources?

Not really.  The main performance enhancement achieved by disabling CAS is
bypassing stack walks caused by demands for permissions that inherit from
System.Security.CodeAccessPermission.  If your code doesn't call into any
code that makes such demands, disabling CAS isn't likely to have much effect
on its performance.


>   5. Has the 2.0 version changed the way CAS works?

Some implemenation details have changed, but the overall concepts remains
pretty similar.  Is there some particular type of change that you are
concerned about?


Show quoteHide quote
>
>
> Please help...
>
> TALIA
> Many regards
> Jack