yannan-wyn commented on code in PR #3270:
URL: https://github.com/apache/brpc/pull/3270#discussion_r3379494943


##########
src/bthread/task_control.cpp:
##########
@@ -205,11 +207,28 @@ TaskControl::TaskControl()
     , _status(print_rq_sizes_in_the_tc, this)
     , _nbthreads("bthread_count")
     , _enable_priority_queue(FLAGS_enable_bthread_priority_queue)
-    , _priority_queues(FLAGS_task_group_ntags)
+    , _pq_num_of_each_tag(FLAGS_event_dispatcher_num)
+    , _priority_queues(FLAGS_task_group_ntags * FLAGS_event_dispatcher_num)

Review Comment:
   > > And WSQ has a cheaper empty steal path. When the queue is empty, 
WSQ::steal() only loads _top and _bottom and returns false:
   > > ```
   > >  t = _top.load(acquire);
   > >   b = _bottom.load(acquire);
   > >   if (t >= b) {
   > >       return false;
   > >   }
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > but atomic slot may
   > > ```
   > >   slot.exchange(INVALID_BTHREAD)
   > > ```
   > 
   > The equivalent operation for slot should be `slot.load()`, right?
   
   Yes, you are right.
   But I mean I did not find an existing single-entry concurrent slot / atomic 
in the current codebase, while WSQ is available.
   Or I can add a more general single-entry primitive in next PR?



-- 
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