You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2020/07/15 03:18:33 UTC

[GitHub] [incubator-brpc] DengJin88 opened a new issue #1164: why ExecutionQueue not designed as a polling mechanism?

DengJin88 opened a new issue #1164:
URL: https://github.com/apache/incubator-brpc/issues/1164


   Hi, we know that ExecutionQueue is worked as a batching mechanism,say we sumbit some tasks and the "execute" runs in one bthread,after processing all the tasks in "iter",it exits the bthread and wait for a next batch tasks,and run again(and it allow t run the tasks "in place",while it still has a "start-process-exit" lift cycle).
   
   Nowdays,polling is popular in area such as intergrating with SPDK,I'd like to write code like following,making the "execute" always looping in one bthread(maybe this idea conflict with bthread design target:it won't do a long runing task while not allow a re-scheduling?):
   
   ```
   int execute(void *meta, bthread::IteratorTask<std::string> &iter) {
     while (iter.is_queue_stopped() == false) {
       for (;iter; ++iter) {
         // submit IO task with spdk
       }
      // submition finished,and I'd like to polling spdk result
      // spdk polling
     }
     return 0;
   }
   ```
   
   while in current ExecutionQueue implemetation,I have to start a another bthread doing polling and send fake task to the ExecutionQueue to trigger SPDK polling thing,is this the better way to use ExectionQueue?


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

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] [incubator-brpc] DengJin88 commented on issue #1164: why ExecutionQueue not designed as a polling mechanism?

Posted by GitBox <gi...@apache.org>.
DengJin88 commented on issue #1164:
URL: https://github.com/apache/incubator-brpc/issues/1164#issuecomment-658739499


   ping @jamesge @llhe 


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

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] [incubator-brpc] DengJin88 edited a comment on issue #1164: why ExecutionQueue not designed as a polling mechanism?

Posted by GitBox <gi...@apache.org>.
DengJin88 edited a comment on issue #1164:
URL: https://github.com/apache/incubator-brpc/issues/1164#issuecomment-658739499


   ping @jamesge


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

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] [incubator-brpc] jamesge commented on issue #1164: why ExecutionQueue not designed as a polling mechanism?

Posted by GitBox <gi...@apache.org>.
jamesge commented on issue #1164:
URL: https://github.com/apache/incubator-brpc/issues/1164#issuecomment-661950226


   ExecutionQueue is designed for running tasks (with dependencies) **in order**, and different ExecutionQueues run in parallel to make good use of CPU cores.  The polling version does not make sense because we're not subscribing "events" that are not controlled by us: the submitted tasks are just created by users, who can perfectly run the tasks one-by-one with a for-loop, without any other code. However, if one of the tasks blocks, the calling thread blocks. If you don't need this behavior, you need ExecutionQueue.


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

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] [incubator-brpc] DengJin88 closed issue #1164: why ExecutionQueue not designed as a polling mechanism?

Posted by GitBox <gi...@apache.org>.
DengJin88 closed issue #1164:
URL: https://github.com/apache/incubator-brpc/issues/1164


   


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

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