Skip to content

Support semaphore and rwlock for bthread#2752

Merged
wwbmmm merged 3 commits into
apache:masterfrom
chenBright:rwlock
Sep 26, 2024
Merged

Support semaphore and rwlock for bthread#2752
wwbmmm merged 3 commits into
apache:masterfrom
chenBright:rwlock

Conversation

@chenBright

@chenBright chenBright commented Sep 1, 2024

Copy link
Copy Markdown
Contributor

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

Comment thread src/bthread/rwlock.h Outdated
@ketor

ketor commented Sep 9, 2024

Copy link
Copy Markdown
Contributor

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

@chenBright

Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

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

@wwbmmm

wwbmmm commented Sep 19, 2024

Copy link
Copy Markdown
Contributor

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
@chenBright chenBright deleted the rwlock branch September 26, 2024 03:01
@chenBright

Copy link
Copy Markdown
Contributor Author

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

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

@chenBright

Copy link
Copy Markdown
Contributor Author

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

@ketor 目前已经在使用了该rwlock实现了吗?

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.

3 participants