-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with SemaphoreSlim on OSX #31502
Comments
(This looks buggy: If I'm understanding your concern correctly, it's that you're having a thread sleep for 100ms between releases, and you're seeing waits on the semaphore take upwards of 172ms. Correct? Have you timed the actual duration of the Thread.Sleep in the instance where the wait on the semaphore takes too long? Have you tried using something other than a SemaphoreSlim? I suspect this isn't actually to do with SemaphoreSlim, and rather is "just" the nature of timings and thread scheduling on macOS. Potentially related to https://github.com/dotnet/coreclr/issues/20369. |
Yep its buggy, but it is just to demonstrate the delay between the release and the actual release of the semaphore.
Yes
Not yet, but will do.
Thanks, I'll investigate this further and time the |
Apparently you were right. The |
Closing as dup of #11226 |
Hello,
I noticed that
SemaphoreSlim.WaitAsync(int)
is sometimes extremely slow on OSX.I was trying to set up a test and build a R2R version of a console app on Azure Pipelines, and noticed that the MacOS tests were failing on a simple wait & release test (logs).
So, I created a simplified version of that test and tried to run again using the same matrix.
Here's the repro, and here is the pipeline with the failed jobs on OSX.
BTW I'm using Linux and I don't have a machine with OSX available to test this.
This issue might be related to #25790
The text was updated successfully, but these errors were encountered: