Do I need to Dispose a SemaphoreSlim
问题 According to the documentation: "a SemaphoreSlim doesn't use a Windows kernel semaphore". Are there any special resources used by the SemaphoreSlim which make it important to call Dispose when the SemaphoreSlim will no longer be used? 回答1: Yes. It may use a ManualResetEvent that uses a SafeWaitHandle which is a SafeHandle and it has an unmanaged handle. You can see it in the reference source here. SafeHandle is finalizable so if you don't dispose of it (by disposing of the SemaphoreSlim ) it