What is a use case for System.Threading.CompressedStack

I am trying to find practical application for System.Threading.CompressedStack. Something cool, not “Oh, we can move the stack from one thread to another for fun,” but rather when you really want to do it or something else that you can do with this interesting little class.

+3
source share
3 answers

It really is intended for internal use by the framework. From the doc:

The CompressedStack class is used inside the SecurityContext class. For example, the SecurityContext.Capture method grabs a compressed stack for the current call stack, as well as impersonation and culture information. The SecurityContext class, in turn, is used by the ExecutionContext class to stream context through threads, for example, when scheduling thread pool tasks.

This class is not used in normal application programming.

+3
source

Directly from the documentation :

"This class is not used in normal application programming."

I assume this is only for unusual application programming.

+4
source

. CAS- (CompressedStack.Capture), , (CompressedStack.Run), " " .

Otherwise, the "trusted" host method will run as untrusted code and will be launched into many SecurityExceptions when trying to access resources protected by CAS.

+1
source

Source: https://habr.com/ru/post/1789385/


All Articles