You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "liangjchen (via GitHub)" <gi...@apache.org> on 2023/02/07 11:24:26 UTC

[GitHub] [brpc] liangjchen opened a new issue, #2110: Question: scheduling of the bthread of ExecutionQueue

liangjchen opened a new issue, #2110:
URL: https://github.com/apache/brpc/issues/2110

   I try to understand scheduling behavior of ExecutionQueue and fit into our scenarios. My understanding is that there is a bthread (consumer) associated with a queue to execute tasks. Is it like a normal concurrent queue such that each time a new task is enqueued, the consumer is notified and woke up to execute? Is there any configuration that allows me to specify the consumer bthread's scheduling, e.g., how often it is scheduled?  
   
   Suppose that I want to introduce a small artificial delay on consumer execution (hoping to gather more tasks in a batch), what's the best option to accomplish this? Is it wise to call ``sleep`` in the consumer bthread? 
   
   thanks,


-- 
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: dev-unsubscribe@brpc.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [brpc] liangjchen closed issue #2110: Question: scheduling of the bthread of ExecutionQueue

Posted by "liangjchen (via GitHub)" <gi...@apache.org>.
liangjchen closed issue #2110: Question: scheduling of the bthread of ExecutionQueue
URL: https://github.com/apache/brpc/issues/2110


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [brpc] cooper-zhzhang commented on issue #2110: Question: scheduling of the bthread of ExecutionQueue

Posted by "cooper-zhzhang (via GitHub)" <gi...@apache.org>.
cooper-zhzhang commented on issue #2110:
URL: https://github.com/apache/brpc/issues/2110#issuecomment-1420727484

   1. 当有新的任务入队时,就会开启一个新的bthread消费队列(如果当时没有bthread在消费)
   2. 目前没有办法指定一个特定的bthread去消费队列中的任务。不过可以设置参数in_place_if_possible指定在当前线程直接执行任务,而不是开启一个新bthread。
   3. 在bthread中调用sleep会造成整个thread休眠。这是不允许的。
   
   


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


[GitHub] [brpc] liangjchen commented on issue #2110: Question: scheduling of the bthread of ExecutionQueue

Posted by "liangjchen (via GitHub)" <gi...@apache.org>.
liangjchen commented on issue #2110:
URL: https://github.com/apache/brpc/issues/2110#issuecomment-1427508808

   thanks. This answers my question. 


-- 
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: dev-unsubscribe@brpc.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org