From 084c06372a727228f7b957862b0332c7551f891d Mon Sep 17 00:00:00 2001 From: Dennis Hezel Date: Fri, 5 Jul 2024 12:29:05 +0200 Subject: [PATCH] feat: Implement thread-safe GrpcContext.run/poll() --- src/agrpc/detail/allocate_operation.hpp | 52 ++-- src/agrpc/detail/atomic_intrusive_queue.hpp | 5 - src/agrpc/detail/basic_sender.hpp | 2 +- .../create_and_submit_no_arg_operation.hpp | 4 +- src/agrpc/detail/grpc_context.ipp | 32 ++- .../detail/grpc_context_implementation.hpp | 47 ++-- .../detail/grpc_context_implementation.ipp | 107 ++++++-- .../detail/grpc_context_local_allocator.hpp | 7 +- src/agrpc/detail/health_check_service.hpp | 10 +- src/agrpc/detail/intrusive_stack.hpp | 60 +++++ src/agrpc/detail/operation.hpp | 4 +- src/agrpc/detail/operation_base.hpp | 1 - src/agrpc/detail/operation_handle.hpp | 2 +- src/agrpc/detail/operation_implementation.hpp | 2 +- src/agrpc/detail/pool_resource.hpp | 235 +++++------------- src/agrpc/detail/pool_resource_allocator.hpp | 32 +-- .../sender_implementation_operation.hpp | 12 +- src/agrpc/detail/server_write_reactor.hpp | 6 +- src/agrpc/detail/stackable_pool_resource.hpp | 35 +++ src/agrpc/grpc_context.hpp | 19 +- src/agrpc/run.hpp | 1 - test/src/test_grpc_context_17.cpp | 23 +- 22 files changed, 364 insertions(+), 334 deletions(-) create mode 100644 src/agrpc/detail/intrusive_stack.hpp create mode 100644 src/agrpc/detail/stackable_pool_resource.hpp diff --git a/src/agrpc/detail/allocate_operation.hpp b/src/agrpc/detail/allocate_operation.hpp index b21858f9..e4741ba0 100644 --- a/src/agrpc/detail/allocate_operation.hpp +++ b/src/agrpc/detail/allocate_operation.hpp @@ -35,53 +35,31 @@ template inline constexpr bool IS_STD_ALLOCATOR> = true; template