Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Thread local without limit by _SC_THREAD_KEYS_MAX #2296

Merged
merged 4 commits into from
Oct 13, 2023

Conversation

chenBright
Copy link
Contributor

What problem does this PR solve?

Issue Number:

Problem Summary:

对于pthread_key使用比较多的场景,pthread_key的硬上限(1024)太小了,不能满足需求。

What is changed and the side effects?

Changed:

参考bRPC中WrapperTLSGroup和pthread_key,实现了thread_key_xxx,解决pthread_key硬上限(1024)太小的问题。
thread_key_xxx接口与pthread_key_xxx接口一一对应。同时在thread_key_xxx的基础上封装了ThreadLocal模板类,方便用户使用tls。

Side effects:

  • Performance effects(性能影响):

  • Breaking backward compatibility(向后兼容性):


Check List:

  • Please make sure your changes are compilable(请确保你的更改可以通过编译).
  • When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
  • Please follow Contributor Covenant Code of Conduct.(请遵循贡献者准则).

@chenBright chenBright changed the title Thread local without num limit Thread local without limit by _SC_THREAD_KEYS_MAX Jul 5, 2023
@wwbmmm
Copy link
Contributor

wwbmmm commented Jul 10, 2023

LGTM

@chenBright chenBright added the feature new feature label Jul 10, 2023
@chenBright
Copy link
Contributor Author

没有其他问题的话,这个PR应该可以合了

@wwbmmm wwbmmm merged commit 25cfdb0 into apache:master Oct 13, 2023
@chenBright chenBright deleted the thread_key branch October 13, 2023 02:21
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants