Skip to content
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

[coop] Synchronization primitive friendliness #2231

Merged
merged 29 commits into from
Dec 2, 2015

Conversation

luhenry
Copy link
Contributor

@luhenry luhenry commented Nov 13, 2015

No description provided.

@luhenry luhenry force-pushed the coop-sync-friendliness branch 12 times, most recently from 42c91e1 to 505f0a4 Compare November 16, 2015 22:32
@luhenry
Copy link
Contributor Author

luhenry commented Nov 16, 2015

@lambdageek @kumpera whenever you have time, would you mind reviewing this PR? Thank you! :)

@luhenry
Copy link
Contributor Author

luhenry commented Nov 16, 2015

For some numbers: when running make check -C mcs/class/corlib, I get a decrease of 10x in blocking state transition.

@kumpera
Copy link
Contributor

kumpera commented Nov 19, 2015

What's causing the 10x reduction in transitions? This change should, if anything, increased the number of transitions.

@luhenry
Copy link
Contributor Author

luhenry commented Nov 19, 2015

luhenry@d435639#diff-df675e7de49d2766cf7cbd6956a00699R50 is what reduces the amount of transitions. We could do the same for semaphores, but we would need to add mono_os_sem_trywait

Move all the code to mono-mutex.c, so it will be easier to make it coop
suspend friendly.
Move all the code to mono-semaphore.c, so it will be easier to make it
coop suspend friendly.
This is to separate from the mono_coop_* mutex and semaphores
Instead of having to use MONO_PREPARE_BLOCKING/MONO_TRY_BLOCKING in the
user code, we do it directly in this new mutex and semaphore coop API.

Using the mono_os_* locking functions should not be the default case, as
that could lead to longer than necessary time to suspend, and even in
certain cases to deadlocks.
@luhenry luhenry force-pushed the coop-sync-friendliness branch 3 times, most recently from cc938b4 to bf5c534 Compare November 23, 2015 21:34
akoeplinger added a commit that referenced this pull request Dec 1, 2015
kumpera added a commit that referenced this pull request Dec 2, 2015
[coop] Synchronization primitive friendliness
@kumpera kumpera merged commit a595d48 into mono:master Dec 2, 2015
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.

2 participants