Skip to content

Conversation

@monojenkins
Copy link
Contributor

!! This PR is a copy of dotnet/runtime#2098, please do not edit or review it in this repo !!
!! Merge the PR only after the original PR is merged !!



This change is motivated on two main fronts. The first is maintainability - the current managed implementation is difficult to understand and I worry diagnosing any potential issues would be a massive time sink. The second is performance - the current implementation appears to suffer from significant lock contention when running the TechEmpower plaintext benchmark. My hope is that the simpler, cleaner native implementation here will avoid both problems, but I don't want to merge it until we have benchmarking data. However, even if the numbers are similar, I still think it's worth merging just from a maintainability perspective.

The native LifoSemaphore implementation has only ever been tested on posix-like platforms, so Windows behavior is unknown. Currently the Windows implementation of LowLevelLifoSemaphore is very different, so unless we have need for the LifoSemaphore elsewhere in the runtime this isn't a concern.

Many thanks to @filipnavara for the initial implementation.

@monojenkins monojenkins force-pushed the sync-pr-2098-from-runtime branch 3 times, most recently from 600710b to 4886e71 Compare January 23, 2020 20:54
@monojenkins monojenkins force-pushed the sync-pr-2098-from-runtime branch from 4886e71 to 1eea698 Compare January 27, 2020 16:55
@CoffeeFlux
Copy link
Contributor

@monojenkins build failed

1 similar comment
@CoffeeFlux
Copy link
Contributor

@monojenkins build failed

@monojenkins monojenkins force-pushed the sync-pr-2098-from-runtime branch from 1eea698 to d95b950 Compare February 5, 2020 19:19
…aphore

This change is motivated on two main fronts. The first is maintainability - the current managed implementation is difficult to understand and I worry diagnosing any potential issues would be a massive time sink. The second is performance - the current implementation appears to suffer from significant lock contention when running the TechEmpower plaintext benchmark. My hope is that the simpler, cleaner native implementation here will avoid both problems, but I don't want to merge it until we have benchmarking data. However, even if the numbers are similar, I still think it's worth merging just from a maintainability perspective.

The native LifoSemaphore implementation has only ever been tested on posix-like platforms, so Windows behavior is unknown. Currently the Windows implementation of LowLevelLifoSemaphore is very different, so unless we have need for the LifoSemaphore elsewhere in the runtime this isn't a concern.

Many thanks to @filipnavara for the initial implementation.
@monojenkins monojenkins force-pushed the sync-pr-2098-from-runtime branch from d95b950 to 18ef716 Compare February 11, 2020 22:24
@CoffeeFlux
Copy link
Contributor

@monojenkins build failed

@CoffeeFlux CoffeeFlux merged commit cd46f5c into mono:master Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants