Go to the documentation of this file.
30 #define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)
34 return reinterpret_cast<void*
>(++
i);
93 for (j = 0; j <
i; j++) {
96 thread_states[
i].
cc =
cc;
113 nullptr, &completions[
i]);
123 #define TEST_THREAD_EVENTS 10000
216 size_t total_consumed = 0;
217 static int optid = 101;
219 gpr_log(
GPR_INFO,
"%s: %" PRIuPTR
" producers, %" PRIuPTR
" consumers",
220 "test_threading", producers, consumers);
225 for (
i = 0;
i < producers + consumers;
i++) {
237 i < producers ?
"grpc_producer" :
"grpc_consumer",
250 for (
i = 0;
i < producers + consumers;
i++) {
265 for (
i = 0;
i < producers + consumers;
i++) {
273 for (
i = 0;
i < producers + consumers;
i++) {
279 for (
i = 0;
i < producers + consumers;
i++) {
283 total_consumed +=
options[
i].events_triggered;
291 int main(
int argc,
char** argv) {
static void pluck_one(void *arg)
gpr_timespec grpc_timeout_seconds_to_deadline(int64_t time_s)
struct test_thread_options test_thread_options
GRPCAPI grpc_completion_queue * grpc_completion_queue_create_for_pluck(void *reserved)
def completion(terminal_metadata, code, message)
GPRAPI void gpr_event_set(gpr_event *ev, void *value)
GPRAPI void gpr_free(void *ptr)
GPRAPI void * gpr_malloc(size_t size)
gpr_timespec ten_seconds_time(void)
GPRAPI gpr_timespec gpr_inf_future(gpr_clock_type type)
void grpc_cq_end_op(grpc_completion_queue *cq, void *tag, grpc_error_handle error, void(*done)(void *done_arg, grpc_cq_completion *storage), void *done_arg, grpc_cq_completion *storage, bool internal)
static void do_nothing_end_completion(void *, grpc_cq_completion *)
static uv_thread_t * threads
int main(int argc, char **argv)
bool tags[kAvailableTags]
static void consumer_thread(void *arg)
static void test_threading(size_t producers, size_t consumers)
grpc_cq_completion_type grpc_get_cq_completion_type(grpc_completion_queue *cq)
gpr_timespec grpc_timeout_milliseconds_to_deadline(int64_t time_ms)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
GPRAPI void gpr_sleep_until(gpr_timespec until)
static void * create_test_tag(void)
GPRAPI void gpr_event_init(gpr_event *ev)
#define GRPC_MAX_COMPLETION_QUEUE_PLUCKERS
static void free_completion(void *, grpc_cq_completion *completion)
GPRAPI void * gpr_event_wait(gpr_event *ev, gpr_timespec abs_deadline)
#define TEST_THREAD_EVENTS
GPRAPI gpr_timespec gpr_inf_past(gpr_clock_type type)
GRPCAPI grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cq, void *tag, gpr_timespec deadline, void *reserved)
bool grpc_cq_begin_op(grpc_completion_queue *cq, void *tag)
#define GPR_ARRAY_SIZE(array)
grpc_completion_queue * cc
GRPCAPI void grpc_completion_queue_destroy(grpc_completion_queue *cq)
grpc_core::ExecCtx exec_ctx
GRPCAPI grpc_event grpc_completion_queue_next(grpc_completion_queue *cq, gpr_timespec deadline, void *reserved)
GRPCAPI void grpc_completion_queue_shutdown(grpc_completion_queue *cq)
static void producer_thread(void *arg)
static void test_too_many_plucks(void)
static void shutdown_and_destroy(grpc_completion_queue *cc)
GRPCAPI grpc_completion_queue * grpc_completion_queue_create_for_next(void *reserved)
grpc_completion_type type
GRPCAPI void grpc_init(void)
GRPCAPI void grpc_shutdown(void)
grpc_completion_queue * cc
grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:52