Regarding the usage of SemaphoreSlim with Async/Await
问题 I am not an advanced developer. I'm just trying to get a hold on the task library and just googling. I've never used the class SemaphoreSlim so I would like to know what it does. Here I present code where SemaphoreSlim is used with async & await but which I do not understand. Could someone help me to understand the code below. 1st set of code await WorkerMainAsync(); async Task WorkerMainAsync() { SemaphoreSlim ss = new SemaphoreSlim(10); while (true) { await ss.WaitAsync(); // you should