Data update

This commit is contained in:
Ingy döt Net 2025-06-11 20:16:52 -04:00
parent 72eb4943cb
commit 4d5544505c
2347 changed files with 62432 additions and 16731 deletions

View file

@ -0,0 +1,18 @@
using System.Diagnostics;
// Methods that return values and don't modify the object
int[] arr = [1, 2, 3, 4, 5];
arr.Reverse();
Console.WriteLine(string.Join(", ", arr));
// Tasks are not threads! There are not 50 threads here even though there are 50 tasks.
// See https://blog.stephencleary.com/2013/11/there-is-no-thread.html
Console.WriteLine(Process.GetCurrentProcess().Threads.Count);
Task[] tasks = [.. Enumerable.Range(0, 50).Select(i => Task.Delay(1000))];
Console.WriteLine(Process.GetCurrentProcess().Threads.Count);
Task.WaitAll(tasks);
Console.WriteLine(Process.GetCurrentProcess().Threads.Count);