DotnetAssembly
DotnetProcessAppdomainThreadContext
o Active threads can be moved to other AppDomains and Context boundaries by the CLR to fit the perfomance.
But it's impossible for a single thread to be working in more than one AppDomain at once.
LoadingStoringValueInILcode
DotnetLanguageCompileProcess
RunDotnetApp
CreateAssemblyByILlanguage
DotnetClrCtsClsBaseclass
DotnetVersionHistory
ManagedUnmanagedCodeAppAndPlatform
ThreadAndSynchronous
ConcurrencyByMultithreadAndAsynchronous
AsyncAwait
o The thing you should note is that when you use "async and await" feature you're not going to sure whether the task which you're trying to process asynchronously is processed on another thread or same calling thread.
That is decided by the CLR, however, CLR allocates the task which you're trying to process asynchronously on another thread against the calling thread as it can as possible.
DelegateAndAsyncButCallingThreadGotBlockedWithWaitingResultFromOtherThread
AsyncCallBackInDelegate
LockKeywordForPrivateInstanceMethod
LockKeywordForPublicMemberOfTheClass
More techniques:
1.Monitor: This is nothing but a shorthand using for lock keyword.
Using lock keyword is converted to the Monitor using after compiled.
2.Interlock.
3.[Synchronization] attribute.
This way can be simple but lazy.
The downfall of this way is that this way makes code rigid because all other codes which doesn't need to be thread-safe are also becoming thread-safe.
4.ThreadPool.
You can pass the method as a argument into WaitCallBack delegate, which you want to execute on secondary threads.
Then delegate object containing above methods can be queued into thread pool via QueueUserWorkItem() method.
And on the secondary threads against primary thread, you can invoke method which you want to invoke.
ThreadPool has pros and cons.
Serialization
ObjectGraph1
ObjectGraph2
IFormatterAndIRemotingFormatter
BinaryAndXmlAndSoapDifferences
BinaryDataRepresentation
XmlAttributes
CustomSerialize
chapter13-1
chapter13-2