// Get the total number of threads in the thread list.
        public override Task <GetNumThreadsResponse> GetNumThreads(GetNumThreadsRequest request,
                                                                   ServerCallContext context)
        {
            SbProcess sbProcess     = GrpcLookupUtils.GetProcess(request.Process, processStore);
            int       numberThreads = sbProcess.GetNumThreads();

            return(Task.FromResult(new GetNumThreadsResponse {
                NumberThreads = numberThreads
            }));
        }
        public int GetNumThreads()
        {
            var request = new GetNumThreadsRequest
            {
                Process = grpcSbProcess
            };
            GetNumThreadsResponse response = null;

            if (connection.InvokeRpc(() =>
            {
                response = client.GetNumThreads(request);
            }))
            {
                return(response.NumberThreads);
            }
            return(0);
        }