Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Update benchmark_lockfree_vs_mutex docs #304

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/benchmark_lockfree_vs_mutex.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ We can use a queue to store the task. The producer can put tasks to the queue an

### Test method

Test code is at here [https://github.com/Qihoo360/evpp/blob/master/benchmark/post_task/post_task6.cc](https://github.com/Qihoo360/evpp/blob/master/benchmark/post_task/post_task6.cc). The producers post task into the queue the only one consumer to execute. We can specify the count of producer threads and the total count of the tasks posted by every producer.
Test code is at here [https://github.com/Qihoo360/evpp/blob/master/evpp/event_loop.cc](https://github.com/Qihoo360/evpp/blob/master/evpp/event_loop.cc). The producers post task into the queue the only one consumer to execute. We can specify the count of producer threads and the total count of the tasks posted by every producer.

The relative code of event_loop.h is bellow:

Expand Down
2 changes: 1 addition & 1 deletion docs/benchmark_lockfree_vs_mutex_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

### 测试方法

测试代码请参考[https://github.com/Qihoo360/evpp/blob/master/benchmark/post_task/post_task6.cc](https://github.com/Qihoo360/evpp/blob/master/benchmark/post_task/post_task6.cc). 在一个消费者线程中运行一个`EventLoop`对象`loop_`,多个生产者线程不停的调用`loop_->QueueInLoop(...)`方法将仿函数执行体放入到消费者的队列中让其消费(执行)。每个生产者线程放入一定总数(由运行参数指定)的仿函数执行体之后就停下来,等消费者线程完全消费完所有的仿函数执行体之后,程序退出,并记录开始和结束时间。
测试代码请参考[https://github.com/Qihoo360/evpp/blob/master/evpp/event_loop.cc](https://github.com/Qihoo360/evpp/blob/master/evpp/event_loop.cc). 在一个消费者线程中运行一个`EventLoop`对象`loop_`,多个生产者线程不停的调用`loop_->QueueInLoop(...)`方法将仿函数执行体放入到消费者的队列中让其消费(执行)。每个生产者线程放入一定总数(由运行参数指定)的仿函数执行体之后就停下来,等消费者线程完全消费完所有的仿函数执行体之后,程序退出,并记录开始和结束时间。

为了便于大家阅读,现将相关代码的核心部分摘录如下。

Expand Down