Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

implausible
Copy link
Contributor

As the library starts using more threads internally to accelerate certain operations, it becomes more necessary to easily usable TLS handles. My threaded checkout PR I opened awhile ago would be able to address the abundance of allocations I introduced around the target_path and tmp buffers in checkout_data by converting those parts of the checkout_data structure to TLS. That way, the performance benefits of not over allocating in single threaded checkout does not suffer at all.

This PR replaces the way we setup the global state on TLS. I was hoping that it might be fairly simple to bring in this change set with #5546 instead of using the proposed tlsdata from that PR.

Thoughts? @ethomson @pks-t

@implausible implausible force-pushed the feature/generic-tls-data branch from 7f4a4ed to 6685afc Compare August 6, 2020 22:56
This adds a generic TLS interface for anyone to store TLS data. It is designed to work regardless of whether threading support is built into the library or not.

Nobody in the library should directly interface with the data on the TLS struct, so it's been built to be opaque even in the library.

Requires the allocator to be initialized before use.
@implausible implausible force-pushed the feature/generic-tls-data branch from 6685afc to 66b24fa Compare August 6, 2020 23:25
@ethomson
Copy link
Member

ethomson commented Oct 5, 2020

Sorry about the delay here. I had a chance to look at this over the weekend. I think that this generally makes sense. I'm trying to figure out how to juggle #5546 and this together. Should be reasonably straightforward.

@ethomson
Copy link
Member

ethomson commented Dec 9, 2020

This is great @implausible, thanks! While I was reviewing it, I was curious about whether we could do this in a way that avoided allocations, and so I wanted to try it. I opened up #5720 with that result, so I'll merge there and close this.

I think that this abstraction is a nice improvement, and I have several thoughts for how we can use it. Thanks again.

@ethomson ethomson closed this Dec 9, 2020
@implausible
Copy link
Contributor Author

Ah, that's awesome. I can't remember what it was, but I had run into an issue trying to do it without an allocation. I much prefer your tweaks.

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