chenBright commented on code in PR #2333:
URL: https://github.com/apache/brpc/pull/2333#discussion_r1281800713


##########
src/bthread/execution_queue_inl.h:
##########
@@ -234,6 +238,13 @@ friend class TaskIteratorBase;
     clear_task_mem _clear_func;
     ExecutionQueueOptions _options;
     butil::atomic<int>* _join_butex;
+
+    // For pthread mode.
+    pthread_t _pid;
+    bool _pthread_started;
+    butil::Mutex _mutex;

Review Comment:
   从ExecutionQueueTest.performance结果来看,对性能是没影响的吧。
   ```shell
   [ RUN      ] ExecutionQueueTest.performance
   I0729 10:30:21.869438  9911 bthread_execution_queue_unittest.cpp:217] 
================ bthread ================
   PROFILE: interrupts/evictions/bytes = 92/8/2992
   I0729 10:30:23.000201  9911 bthread_execution_queue_unittest.cpp:240] With 
addressed execq, each execution_queue_execute takes 957 total_num=4078814 ns 
with 8 threads
   PROFILE: interrupts/evictions/bytes = 100/1/6416
   I0729 10:30:23.881414  9911 bthread_execution_queue_unittest.cpp:266] With 
id explicitly, execution_queue_execute takes 1578 total_num=2505991 ns with 8 
threads
   I0729 10:30:23.881448  9911 bthread_execution_queue_unittest.cpp:215] 
================ pthread ================
   PROFILE: interrupts/evictions/bytes = 55/7/2568
   I0729 10:30:24.918703  9911 bthread_execution_queue_unittest.cpp:240] With 
addressed execq, each execution_queue_execute takes 591 total_num=3632640 ns 
with 8 threads
   PROFILE: interrupts/evictions/bytes = 96/1/5576
   I0729 10:30:25.824709  9911 bthread_execution_queue_unittest.cpp:266] With 
id explicitly, execution_queue_execute takes 1562 total_num=2530991 ns with 8 
threads
   [       OK ] ExecutionQueueTest.performance (3955 ms)
   ```



##########
src/bthread/execution_queue_inl.h:
##########
@@ -234,6 +238,13 @@ friend class TaskIteratorBase;
     clear_task_mem _clear_func;
     ExecutionQueueOptions _options;
     butil::atomic<int>* _join_butex;
+
+    // For pthread mode.
+    pthread_t _pid;
+    bool _pthread_started;
+    butil::Mutex _mutex;

Review Comment:
   从ExecutionQueueTest.performance结果来看,对性能是没影响的吧。
   ```shell
   [ RUN      ] ExecutionQueueTest.performance
   I0729 10:30:21.869438  9911 bthread_execution_queue_unittest.cpp:217] 
================ bthread ================
   PROFILE: interrupts/evictions/bytes = 92/8/2992
   I0729 10:30:23.000201  9911 bthread_execution_queue_unittest.cpp:240] With 
addressed execq, each execution_queue_execute takes 957 total_num=4078814 ns 
with 8 threads
   PROFILE: interrupts/evictions/bytes = 100/1/6416
   I0729 10:30:23.881414  9911 bthread_execution_queue_unittest.cpp:266] With 
id explicitly, execution_queue_execute takes 1578 total_num=2505991 ns with 8 
threads
   I0729 10:30:23.881448  9911 bthread_execution_queue_unittest.cpp:215] 
================ pthread ================
   PROFILE: interrupts/evictions/bytes = 55/7/2568
   I0729 10:30:24.918703  9911 bthread_execution_queue_unittest.cpp:240] With 
addressed execq, each execution_queue_execute takes 591 total_num=3632640 ns 
with 8 threads
   PROFILE: interrupts/evictions/bytes = 96/1/5576
   I0729 10:30:25.824709  9911 bthread_execution_queue_unittest.cpp:266] With 
id explicitly, execution_queue_execute takes 1562 total_num=2530991 ns with 8 
threads
   [       OK ] ExecutionQueueTest.performance (3955 ms)
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to