Value types are stored in the heap when they are part of the reference type.
Reference types vs Value types
Reference types:
- passed via reference
- reside on the heap
- subject to GC
- inherits from
System.Object
Value types:
- passed via value
- reside on the stack, CPU registers or the heap
- no subject to GC
- inherits from
System.ValueType
Further read:
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types
https://www.infoworld.com/article/3043992/a-deep-dive-value-and-reference-types-in-net.html
.NET Type System
- shared type system across all .net languages
- primitives data types library
- 5 kind of types:
- classes
- structures
- enumerations
- interfaces
- delegates
Further read:
https://learn.microsoft.com/en-us/dotnet/standard/base-types/common-type-system
ThreadPool
- provides a pool of threads
- can be used to execute tasks
- post work items
- process asynchronous I/O
- process timers
Further read:
https://learn.microsoft.com/en-us/dotnet/api/system.threading.threadpool?view=net-6.0
Task Parallel Library (TPL)
- simplify process of adding parallelism and concurrency to application
- scales concurrency automatically
- data parallelism
- task based
async
programming - data flow
Further read:
https://learn.microsoft.com/en-us/dotnet/standard/parallel-programming/task-parallel-library-tpl