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

Offer API to adjust the ArrayPool #1122

Merged
merged 4 commits into from
Nov 19, 2020
Merged

Offer API to adjust the ArrayPool #1122

merged 4 commits into from
Nov 19, 2020

Conversation

Nirklav
Copy link
Contributor

@Nirklav Nirklav commented Nov 16, 2020

Hey! We have had problems on our production server with ArrayPool from the .net framework in the MP library.
GC couldn't stop some message pack threads that were in spin lock in the critical section, so the server had random long Stop The World sometimes (some of them reached up to 10 seconds).

So we want to use TlsOverPerCoreLockedStacksArrayPool from .net core. We can take it from core repo to our code, but we can't change DefaultArrayPool to that pool in MP. That’s why I decided to add the possibility to change ArrayPool implementation.

P.S. We are using .net 4.7.2.

zlRabcJ

Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very good. Thanks for contributing. Just a couple of hopefully small comments.

Issue with metgod WithPool was fixed;
@Nirklav Nirklav requested a review from AArnott November 18, 2020 11:17
Copy link
Collaborator

@AArnott AArnott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. @neuecc Do you have anything else to add?

@Nirklav
Copy link
Contributor Author

Nirklav commented Nov 19, 2020

Looks fine. I don't have anything to add.

@neuecc
Copy link
Member

neuecc commented Nov 19, 2020

I think it's very good (I also wanted the opportunity to expand the size of the Pool, so I'm personally happy too), thank you.

@AArnott AArnott merged commit 604de7c into MessagePack-CSharp:develop Nov 19, 2020
@AArnott AArnott added this to the v2.3 milestone Nov 19, 2020
@AArnott AArnott changed the title Way to set custom array pool was added. Offer API to adjust the ArrayPool Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants