Pipeline: use notify instead of polling for ExchangeReceiver#9073
Pipeline: use notify instead of polling for ExchangeReceiver#9073ti-chi-bot[bot] merged 40 commits intopingcap:masterfrom
ExchangeReceiver#9073Conversation
ExchangeReceiverExchangeReceiver
| : queue(log_, std::forward<Args>(args)...) | ||
| {} | ||
|
|
||
| void registerTask(TaskPtr && task) override { queue.registerPipeReadTask(std::move(task)); } |
There was a problem hiding this comment.
maybe rename it to registerPipelineReadTask?
There was a problem hiding this comment.
Because this is an override of NotifyFuture::registerTask, it cannot be renamed
| private: | ||
| using QueueImpl = LooseBoundedMPMCQueue<ReceivedMessagePtr>; | ||
| // these are unbounded queues. | ||
| std::unique_ptr<QueueImpl> queue = std::make_unique<QueueImpl>(std::numeric_limits<size_t>::max()); |
There was a problem hiding this comment.
Why use unique_ptr? Also, how about letting MSGChannel inherits LooseBoundedMPMCQueue<ReceivedMessagePtr>?
There was a problem hiding this comment.
ref #7963,
Because LooseBoundedMPMCQueue includes locks, it must use unique_ptr or shared_ptr somewhere.
| void registerPipeWriteTask(TaskPtr && task) { queue.registerPipeWriteTask(std::move(task)); } | ||
|
|
||
| private: | ||
| GRPCRecvQueue<ReceivedMessagePtr> queue; |
There was a problem hiding this comment.
How about directly letting GRPCRecvNotifyQueue inherit GRPCRecvQueue<ReceivedMessagePtr>? If so, these functions do not need to be written, only the registerTask function is required.
fa91f69 to
bb18d78
Compare
Signed-off-by: gengliqi <gengliqiii@gmail.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gengliqi, windtalker The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
|
/retest |
|
/retest |
What problem does this PR solve?
Issue Number: ref #8869
Problem Summary:
What is changed and how it works?
The cpu usage of wait reactor is reduced to 0 in tpch50.

Check List
Tests
Tested tpch50, no performance regression
Side effects
Documentation
Release note