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

Support semaphore and rwlock for bthread #2752

Merged
merged 3 commits into from
Sep 26, 2024
Merged

Conversation

chenBright
Copy link
Contributor

@chenBright chenBright commented Sep 1, 2024

What problem does this PR solve?

Issue Number:

Problem Summary:

What is changed and the side effects?

Changed:

  1. 按照golang读写锁原理,在bRPC实现了对应的读写锁。
  2. 支持bthread信号量,用于满足读写锁的实现需求,同时开放给用户使用。
  3. contention profiler支持bthread信号量和读写锁。

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.(请遵循贡献者准则).

@ketor
Copy link
Contributor

ketor commented Sep 9, 2024

请问这个PR什么时候可以合入呢? 对rwlock有需求,之前提个PR被反馈性能不好,希望尽快用上官方的实现

@chenBright
Copy link
Contributor Author

请问这个PR什么时候可以合入呢? 对rwlock有需求,之前提个PR被反馈性能不好,希望尽快用上官方的实现

没那么快。读写锁的核心功能已经实现了,还有一些需要优化的地方。

@chenBright chenBright force-pushed the rwlock branch 3 times, most recently from 361afcc to 01e9fb0 Compare September 18, 2024 02:35
@chenBright
Copy link
Contributor Author

@wwbmmm 再看看。整理了一下commit,分成三部分,review起来清晰一点。

@wwbmmm
Copy link
Contributor

wwbmmm commented Sep 19, 2024

LGTM

@chenBright chenBright changed the title Support bthread rwlock Support semaphore and rwlock for bthread Sep 19, 2024
@wwbmmm wwbmmm merged commit f17048e into apache:master Sep 26, 2024
20 checks passed
@chenBright chenBright deleted the rwlock branch September 26, 2024 03:01
@chenBright
Copy link
Contributor Author

请问这个PR什么时候可以合入呢? 对rwlock有需求,之前提个PR被反馈性能不好,希望尽快用上官方的实现

@ketor 读写锁的PR已经合入了。之前用#2748 的UT对比了一下两个实现的性能,本PR的性能比#2748 要好一些。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants