Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5273 Returned to use named mutex, because the named semaphore doesn'…
…t support bu UNIX based systems
- Loading branch information
Showing
2 changed files
with
19 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
b4a113e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question... using RuntimeInformation.IsOSPlatform, can we not store the platform at startup, then depending on the platform being used, use semaphore or mutex if the platform is Windows/UNIX?
https://docs.microsoft.com/en-us/dotnet/standard/analyzers/platform-compat-analyzer
b4a113e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @untiedshoes. technically it is possible, but we decided not to complicate the code. We also created an issue #5256 and will try to avoid using mutex as and semaphore
b4a113e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Sergey :)
That being said, as all my clients run on windows, for now (until there's a better solution), am I better off using Semaphore rather than Mutex? I'll give the 'ResourcesLocker' in #5499 a try too.
Craig
b4a113e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@untiedshoes.
We are not sure about request #5499, but ticket #5498 says that the proposed solution is not very productive.
if all your users are on Windows, then the semaphore is better since it does not require code synchronization, but you can leave it as it is until the next release, since synchronization via a mutex should not greatly affect performance, since these methods are not often called
b4a113e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I did some load testing on it, and although it resulted in less blocking, and I didn't need to increase the max pool size via the connection string, the overall response times where much worse under heavy load.
Okay, for now, I'll use semaphore until the next release :)
Thanks again Sergey :)