CategoriesAsync & Concurrency

Async & Concurrency

2 features across 2 C# versions

C# 52012

Asynchronous async / await

Frees active pooling execution threads during underlying network I/O calls without complex nesting styles.

1public async Task<int> FetchDataAsync() {
2 var res = await _client.GetAsync(url);
3 return res.StatusCode;
4}
C# 132024

Dedicated Lock Object Support

Introduces a native, high-performance thread-blocking mechanism via the specialized System.Threading.Lock type.

1private readonly System.Threading.Lock _syncLock = new();
2public void ProcessSafely() {
3 lock (_syncLock) { /* Exclusive section */ }
4}