[c++] Questions about the number of working threads .

25 views
Skip to first unread message

Arthur Wang

unread,
Aug 30, 2018, 4:53:15 AM8/30/18
to grpc.io
Hi all :
    I'm using the cpp version of grpc server(1.8.x) . I have some questions about the worker thread (theads which process the actual RPC request) :

   Is the number of worker thread dynamic ? 

      1>   If so : 
           1)  when will  the number  increase and when to decrease ?  Does it depends on the payload and will be adjusted automatically by the framework  ?
           2)  If I don't want to the worker threads to change(come and go) too frequently (I'm doing stuff based on the thread ID, which will get messed up if their ID always change), is there any way to control ?

       2> If not (This is the behavior which will make my job to be easy):
           1) how to specify the exact number of worker thread ?

    Actually , I'm implementing a lockfree multiple producer ringbuf queue which will be used in the  RPC calls. And the worker threads will act as the producers.
    I maintained a lastest production position(based on tid) for each of these threads , and if they changes too fast, will bring me a lot of trouble to deal with .

   
Thanks a lot.


Reply all
Reply to author
Forward
0 new messages