Thanks for posting your question in the Microsoft Q&A forum.
SemaphoreSlim manages access to a limited resource by maintaining an internal counter. When threads request access, the counter is decremented if slots are available. Threads are granted immediate access if the counter is positive, otherwise, they wait in a FIFO queue. When a thread releases access, the counter is incremented, allowing the next waiting thread to proceed. SemaphoreSlim is efficient and lightweight, ideal for controlling shared resource access across multiple threads without excessive blocking or context switching.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful