aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/distributed_runtime
diff options
context:
space:
mode:
authorGravatar Akshay Modi <nareshmodi@google.com>2018-07-23 18:02:53 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-07-23 18:06:26 -0700
commitd58d099edb59ba22e35067d5538edd91fae00e74 (patch)
tree8f8f3439b3a74732fb5588105e18da746c6df089 /tensorflow/core/distributed_runtime
parentdcf568a4e297bb70a74ed5665b924077b9cb650a (diff)
Remove unnecessary thread pool and use the worker env's compute pool directly.
PiperOrigin-RevId: 205756865
Diffstat (limited to 'tensorflow/core/distributed_runtime')
-rw-r--r--tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.cc4
-rw-r--r--tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.h5
2 files changed, 3 insertions, 6 deletions
diff --git a/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.cc b/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.cc
index 52e06c263d..44e880de04 100644
--- a/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.cc
+++ b/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.cc
@@ -27,9 +27,7 @@ namespace eager {
GrpcEagerServiceImpl::GrpcEagerServiceImpl(
const WorkerEnv* env, ::grpc::ServerBuilder* server_builder)
- : local_impl_(env) {
- request_handler_threadpool_ =
- MakeUnique<thread::ThreadPool>(env->env, "EagerServiceRequestHandler", 4);
+ : env_(env), local_impl_(env) {
server_builder->RegisterService(&service_);
cq_ = server_builder->AddCompletionQueue();
}
diff --git a/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.h b/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.h
index 9a94026342..502f3ef529 100644
--- a/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.h
+++ b/tensorflow/core/distributed_runtime/rpc/eager/grpc_eager_service_impl.h
@@ -45,7 +45,7 @@ class GrpcEagerServiceImpl : public AsyncServiceInterface {
private:
#define HANDLER(method) \
void method##Handler(EagerCall<method##Request, method##Response>* call) { \
- request_handler_threadpool_->Schedule([this, call]() { \
+ env_->compute_pool->Schedule([this, call]() { \
call->SendResponse( \
ToGrpcStatus(local_impl_.method(&call->request, &call->response))); \
}); \
@@ -64,6 +64,7 @@ class GrpcEagerServiceImpl : public AsyncServiceInterface {
HANDLER(RegisterFunction);
#undef HANDLER
+ const WorkerEnv* const env_; // Not owned.
EagerServiceImpl local_impl_;
std::unique_ptr<::grpc::Alarm> shutdown_alarm_;
@@ -71,8 +72,6 @@ class GrpcEagerServiceImpl : public AsyncServiceInterface {
std::unique_ptr<::grpc::ServerCompletionQueue> cq_;
tensorflow::eager::grpc::EagerService::AsyncService service_;
- std::unique_ptr<thread::ThreadPool> request_handler_threadpool_;
-
TF_DISALLOW_COPY_AND_ASSIGN(GrpcEagerServiceImpl);
};