Ybbest
Ybbest

Reputation: 1550

What are the differences between currently executing .NET thread and Win32 thread

I am reading the Asp.net security documentation on msdn.I come across these tow terms and get really confused.

# WindowsIdentity = WindowsIdentity.GetCurrent()

which returns the identity of the security context of the currently executing Win32 thread.

# Thread = Thread.CurrentPrincipal 

which returns the principal of the currently executing .NET thread which rides on top of the Win32 thread.

Upvotes: 1

Views: 112

Answers (1)

Mark Byers
Mark Byers

Reputation: 838796

There isn't guaranteed to be a one-to-one mapping between operating system threads and .NET threads. Usually you only need to care about the .NET thread. Which OS thread your .NET Thread happens to be running on right now is an implementation detail which you shouldn't rely on.

Upvotes: 2

Related Questions