benchmark-multi-accept.c
Go to the documentation of this file.
1 /* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to
5  * deal in the Software without restriction, including without limitation the
6  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7  * sell copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19  * IN THE SOFTWARE.
20  */
21 
22 #include "task.h"
23 #include "uv.h"
24 
25 #define IPC_PIPE_NAME TEST_PIPENAME
26 #define NUM_CONNECTS (250 * 1000)
27 
31 };
32 
33 /* Use as (uv_stream_t *) &handle_storage -- it's kind of clunky but it
34  * avoids aliasing warnings.
35  */
36 typedef unsigned char handle_storage_t[sizeof(union stream_handle)];
37 
38 /* Used for passing around the listen handle, not part of the benchmark proper.
39  * We have an overabundance of server types here. It works like this:
40  *
41  * 1. The main thread starts an IPC pipe server.
42  * 2. The worker threads connect to the IPC server and obtain a listen handle.
43  * 3. The worker threads start accepting requests on the listen handle.
44  * 4. The main thread starts connecting repeatedly.
45  *
46  * Step #4 should perhaps be farmed out over several threads.
47  */
50  unsigned int num_connects;
52 };
53 
54 struct ipc_peer_ctx {
57 };
58 
63  char scratch[16];
64 };
65 
66 /* Used in the actual benchmark. */
67 struct server_ctx {
69  unsigned int num_connects;
73 };
74 
75 struct client_ctx {
77  unsigned int num_connects;
80 };
81 
82 static void ipc_connection_cb(uv_stream_t* ipc_pipe, int status);
83 static void ipc_write_cb(uv_write_t* req, int status);
84 static void ipc_close_cb(uv_handle_t* handle);
85 static void ipc_connect_cb(uv_connect_t* req, int status);
86 static void ipc_read_cb(uv_stream_t* handle,
87  ssize_t nread,
88  const uv_buf_t* buf);
89 static void ipc_alloc_cb(uv_handle_t* handle,
90  size_t suggested_size,
91  uv_buf_t* buf);
92 
93 static void sv_async_cb(uv_async_t* handle);
95 static void sv_read_cb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf);
96 static void sv_alloc_cb(uv_handle_t* handle,
97  size_t suggested_size,
98  uv_buf_t* buf);
99 
100 static void cl_connect_cb(uv_connect_t* req, int status);
101 static void cl_idle_cb(uv_idle_t* handle);
102 static void cl_close_cb(uv_handle_t* handle);
103 
104 static struct sockaddr_in listen_addr;
105 
106 
107 static void ipc_connection_cb(uv_stream_t* ipc_pipe, int status) {
108  struct ipc_server_ctx* sc;
109  struct ipc_peer_ctx* pc;
110  uv_loop_t* loop;
111  uv_buf_t buf;
112 
113  loop = ipc_pipe->loop;
114  buf = uv_buf_init("PING", 4);
115  sc = container_of(ipc_pipe, struct ipc_server_ctx, ipc_pipe);
116  pc = calloc(1, sizeof(*pc));
117  ASSERT(pc != NULL);
118 
119  if (ipc_pipe->type == UV_TCP)
120  ASSERT(0 == uv_tcp_init(loop, (uv_tcp_t*) &pc->peer_handle));
121  else if (ipc_pipe->type == UV_NAMED_PIPE)
122  ASSERT(0 == uv_pipe_init(loop, (uv_pipe_t*) &pc->peer_handle, 1));
123  else
124  ASSERT(0);
125 
126  ASSERT(0 == uv_accept(ipc_pipe, (uv_stream_t*) &pc->peer_handle));
127  ASSERT(0 == uv_write2(&pc->write_req,
128  (uv_stream_t*) &pc->peer_handle,
129  &buf,
130  1,
131  (uv_stream_t*) &sc->server_handle,
132  ipc_write_cb));
133 
134  if (--sc->num_connects == 0)
135  uv_close((uv_handle_t*) ipc_pipe, NULL);
136 }
137 
138 
139 static void ipc_write_cb(uv_write_t* req, int status) {
140  struct ipc_peer_ctx* ctx;
142  uv_close((uv_handle_t*) &ctx->peer_handle, ipc_close_cb);
143 }
144 
145 
147  struct ipc_peer_ctx* ctx;
149  free(ctx);
150 }
151 
152 
153 static void ipc_connect_cb(uv_connect_t* req, int status) {
154  struct ipc_client_ctx* ctx;
156  ASSERT(0 == status);
157  ASSERT(0 == uv_read_start((uv_stream_t*) &ctx->ipc_pipe,
158  ipc_alloc_cb,
159  ipc_read_cb));
160 }
161 
162 
164  size_t suggested_size,
165  uv_buf_t* buf) {
166  struct ipc_client_ctx* ctx;
168  buf->base = ctx->scratch;
169  buf->len = sizeof(ctx->scratch);
170 }
171 
172 
174  ssize_t nread,
175  const uv_buf_t* buf) {
176  struct ipc_client_ctx* ctx;
177  uv_loop_t* loop;
180 
183  loop = ipc_pipe->loop;
184 
187  if (type == UV_TCP)
188  ASSERT(0 == uv_tcp_init(loop, (uv_tcp_t*) ctx->server_handle));
189  else if (type == UV_NAMED_PIPE)
190  ASSERT(0 == uv_pipe_init(loop, (uv_pipe_t*) ctx->server_handle, 0));
191  else
192  ASSERT(0);
193 
194  ASSERT(0 == uv_accept(handle, ctx->server_handle));
195  uv_close((uv_handle_t*) &ctx->ipc_pipe, NULL);
196 }
197 
198 
199 /* Set up an IPC pipe server that hands out listen sockets to the worker
200  * threads. It's kind of cumbersome for such a simple operation, maybe we
201  * should revive uv_import() and uv_export().
202  */
204  unsigned int num_servers,
205  struct server_ctx* servers) {
206  struct ipc_server_ctx ctx;
207  uv_loop_t* loop;
208  unsigned int i;
209 
210  loop = uv_default_loop();
211  ctx.num_connects = num_servers;
212 
213  if (type == UV_TCP) {
214  ASSERT(0 == uv_tcp_init(loop, (uv_tcp_t*) &ctx.server_handle));
215  ASSERT(0 == uv_tcp_bind((uv_tcp_t*) &ctx.server_handle,
216  (const struct sockaddr*) &listen_addr,
217  0));
218  }
219  else
220  ASSERT(0);
221  /* We need to initialize this pipe with ipc=0 - this is not a uv_pipe we'll
222  * be sending handles over, it's just for listening for new connections.
223  * If we accept a connection then the connected pipe must be initialized
224  * with ipc=1.
225  */
226  ASSERT(0 == uv_pipe_init(loop, &ctx.ipc_pipe, 0));
227  ASSERT(0 == uv_pipe_bind(&ctx.ipc_pipe, IPC_PIPE_NAME));
228  ASSERT(0 == uv_listen((uv_stream_t*) &ctx.ipc_pipe, 128, ipc_connection_cb));
229 
230  for (i = 0; i < num_servers; i++)
231  uv_sem_post(&servers[i].semaphore);
232 
234  uv_close((uv_handle_t*) &ctx.server_handle, NULL);
236 
237  for (i = 0; i < num_servers; i++)
238  uv_sem_wait(&servers[i].semaphore);
239 }
240 
241 
243  struct ipc_client_ctx ctx;
244 
245  ctx.server_handle = server_handle;
246  ctx.server_handle->data = "server handle";
247 
248  ASSERT(0 == uv_pipe_init(loop, &ctx.ipc_pipe, 1));
249  uv_pipe_connect(&ctx.connect_req,
250  &ctx.ipc_pipe,
254 }
255 
256 
257 static void server_cb(void *arg) {
258  struct server_ctx *ctx;
259  uv_loop_t loop;
260 
261  ctx = arg;
262  ASSERT(0 == uv_loop_init(&loop));
263 
264  ASSERT(0 == uv_async_init(&loop, &ctx->async_handle, sv_async_cb));
265  uv_unref((uv_handle_t*) &ctx->async_handle);
266 
267  /* Wait until the main thread is ready. */
268  uv_sem_wait(&ctx->semaphore);
269  get_listen_handle(&loop, (uv_stream_t*) &ctx->server_handle);
270  uv_sem_post(&ctx->semaphore);
271 
272  /* Now start the actual benchmark. */
273  ASSERT(0 == uv_listen((uv_stream_t*) &ctx->server_handle,
274  128,
276  ASSERT(0 == uv_run(&loop, UV_RUN_DEFAULT));
277 
279 }
280 
281 
283  struct server_ctx* ctx;
285  uv_close((uv_handle_t*) &ctx->server_handle, NULL);
286  uv_close((uv_handle_t*) &ctx->async_handle, NULL);
287 }
288 
289 
292  struct server_ctx* ctx;
293 
295  ASSERT(status == 0);
296 
297  storage = malloc(sizeof(*storage));
298  ASSERT(storage != NULL);
299 
300  if (server_handle->type == UV_TCP)
302  else if (server_handle->type == UV_NAMED_PIPE)
303  ASSERT(0 == uv_pipe_init(server_handle->loop, (uv_pipe_t*) storage, 0));
304  else
305  ASSERT(0);
306 
309  ctx->num_connects++;
310 }
311 
312 
314  size_t suggested_size,
315  uv_buf_t* buf) {
316  static char slab[32];
317  buf->base = slab;
318  buf->len = sizeof(slab);
319 }
320 
321 
323  ssize_t nread,
324  const uv_buf_t* buf) {
325  ASSERT(nread == UV_EOF);
327 }
328 
329 
330 static void cl_connect_cb(uv_connect_t* req, int status) {
331  struct client_ctx* ctx = container_of(req, struct client_ctx, connect_req);
332  uv_idle_start(&ctx->idle_handle, cl_idle_cb);
333  ASSERT(0 == status);
334 }
335 
336 
337 static void cl_idle_cb(uv_idle_t* handle) {
339  uv_close((uv_handle_t*) &ctx->client_handle, cl_close_cb);
340  uv_idle_stop(&ctx->idle_handle);
341 }
342 
343 
345  struct client_ctx* ctx;
346 
348 
349  if (--ctx->num_connects == 0) {
350  uv_close((uv_handle_t*) &ctx->idle_handle, NULL);
351  return;
352  }
353 
354  ASSERT(0 == uv_tcp_init(handle->loop, (uv_tcp_t*) &ctx->client_handle));
355  ASSERT(0 == uv_tcp_connect(&ctx->connect_req,
356  (uv_tcp_t*) &ctx->client_handle,
357  (const struct sockaddr*) &listen_addr,
358  cl_connect_cb));
359 }
360 
361 
362 static int test_tcp(unsigned int num_servers, unsigned int num_clients) {
363  struct server_ctx* servers;
364  struct client_ctx* clients;
365  uv_loop_t* loop;
366  uv_tcp_t* handle;
367  unsigned int i;
368  double time;
369 
370  ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &listen_addr));
371  loop = uv_default_loop();
372 
373  servers = calloc(num_servers, sizeof(servers[0]));
374  clients = calloc(num_clients, sizeof(clients[0]));
375  ASSERT(servers != NULL);
376  ASSERT(clients != NULL);
377 
378  /* We're making the assumption here that from the perspective of the
379  * OS scheduler, threads are functionally equivalent to and interchangeable
380  * with full-blown processes.
381  */
382  for (i = 0; i < num_servers; i++) {
383  struct server_ctx* ctx = servers + i;
384  ASSERT(0 == uv_sem_init(&ctx->semaphore, 0));
385  ASSERT(0 == uv_thread_create(&ctx->thread_id, server_cb, ctx));
386  }
387 
388  send_listen_handles(UV_TCP, num_servers, servers);
389 
390  for (i = 0; i < num_clients; i++) {
391  struct client_ctx* ctx = clients + i;
392  ctx->num_connects = NUM_CONNECTS / num_clients;
393  handle = (uv_tcp_t*) &ctx->client_handle;
394  handle->data = "client handle";
395  ASSERT(0 == uv_tcp_init(loop, handle));
396  ASSERT(0 == uv_tcp_connect(&ctx->connect_req,
397  handle,
398  (const struct sockaddr*) &listen_addr,
399  cl_connect_cb));
400  ASSERT(0 == uv_idle_init(loop, &ctx->idle_handle));
401  }
402 
403  {
404  uint64_t t = uv_hrtime();
406  t = uv_hrtime() - t;
407  time = t / 1e9;
408  }
409 
410  for (i = 0; i < num_servers; i++) {
411  struct server_ctx* ctx = servers + i;
412  uv_async_send(&ctx->async_handle);
413  ASSERT(0 == uv_thread_join(&ctx->thread_id));
414  uv_sem_destroy(&ctx->semaphore);
415  }
416 
417  printf("accept%u: %.0f accepts/sec (%u total)\n",
418  num_servers,
419  NUM_CONNECTS / time,
420  NUM_CONNECTS);
421 
422  for (i = 0; i < num_servers; i++) {
423  struct server_ctx* ctx = servers + i;
424  printf(" thread #%u: %.0f accepts/sec (%u total, %.1f%%)\n",
425  i,
426  ctx->num_connects / time,
427  ctx->num_connects,
428  ctx->num_connects * 100.0 / NUM_CONNECTS);
429  }
430 
431  free(clients);
432  free(servers);
433 
435  return 0;
436 }
437 
438 
439 BENCHMARK_IMPL(tcp_multi_accept2) {
440  return test_tcp(2, 40);
441 }
442 
443 
444 BENCHMARK_IMPL(tcp_multi_accept4) {
445  return test_tcp(4, 40);
446 }
447 
448 
449 BENCHMARK_IMPL(tcp_multi_accept8) {
450  return test_tcp(8, 40);
451 }
uv_pipe_pending_count
UV_EXTERN int uv_pipe_pending_count(uv_pipe_t *handle)
Definition: unix/pipe.c:298
async_greeter_server_with_graceful_shutdown.loop
loop
Definition: async_greeter_server_with_graceful_shutdown.py:59
sv_async_cb
static void sv_async_cb(uv_async_t *handle)
Definition: benchmark-multi-accept.c:282
slab
static char slab[1]
Definition: test-watcher-cross-stop.c:37
stream_handle::tcp
uv_tcp_t tcp
Definition: benchmark-multi-accept.c:30
handle_storage_t
unsigned char handle_storage_t[sizeof(union stream_handle)]
Definition: benchmark-multi-accept.c:36
task.h
cl_idle_cb
static void cl_idle_cb(uv_idle_t *handle)
Definition: benchmark-multi-accept.c:337
ctx
Definition: benchmark-async.c:30
ipc_server_ctx
Definition: benchmark-multi-accept.c:48
ipc_connect_cb
static void ipc_connect_cb(uv_connect_t *req, int status)
Definition: benchmark-multi-accept.c:153
uv_pipe_connect
UV_EXTERN void uv_pipe_connect(uv_connect_t *req, uv_pipe_t *handle, const char *name, uv_connect_cb cb)
Definition: unix/pipe.c:173
uv_pipe_init
UV_EXTERN int uv_pipe_init(uv_loop_t *, uv_pipe_t *handle, int ipc)
Definition: unix/pipe.c:33
ipc_connection_cb
static void ipc_connection_cb(uv_stream_t *ipc_pipe, int status)
Definition: benchmark-multi-accept.c:107
uv_handle_type
uv_handle_type
Definition: uv.h:189
uv_connect_s
Definition: uv.h:580
ipc_client_ctx::scratch
char scratch[16]
Definition: benchmark-multi-accept.c:63
idle_handle
static uv_idle_t idle_handle
Definition: benchmark-loop-count.c:31
IPC_PIPE_NAME
#define IPC_PIPE_NAME
Definition: benchmark-multi-accept.c:25
buf
voidpf void * buf
Definition: bloaty/third_party/zlib/contrib/minizip/ioapi.h:136
uv_listen
UV_EXTERN int uv_listen(uv_stream_t *stream, int backlog, uv_connection_cb cb)
Definition: unix/stream.c:656
printf
_Use_decl_annotations_ int __cdecl printf(const char *_Format,...)
Definition: cs_driver.c:91
ASSERT
#define ASSERT(expr)
Definition: task.h:102
server_cb
static void server_cb(void *arg)
Definition: benchmark-multi-accept.c:257
ipc_client_ctx::connect_req
uv_connect_t connect_req
Definition: benchmark-multi-accept.c:60
status
absl::Status status
Definition: rls.cc:251
server_ctx::num_connects
unsigned int num_connects
Definition: benchmark-multi-accept.c:69
ctx
static struct test_ctx ctx
Definition: test-ipc-send-recv.c:65
uv_thread_join
UV_EXTERN int uv_thread_join(uv_thread_t *tid)
Definition: libuv/src/unix/thread.c:271
write_req
Definition: benchmark-tcp-write-batch.c:31
sv_connection_cb
static void sv_connection_cb(uv_stream_t *server_handle, int status)
Definition: benchmark-multi-accept.c:290
server_ctx::server_handle
handle_storage_t server_handle
Definition: benchmark-multi-accept.c:68
uv_run
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
Definition: unix/core.c:361
stream_handle
Definition: benchmark-multi-accept.c:28
container_of
#define container_of(ptr, type, member)
Definition: uv-common.h:57
listen_addr
static struct sockaddr_in listen_addr
Definition: benchmark-multi-accept.c:104
client_ctx
Definition: benchmark-multi-accept.c:75
uv_unref
UV_EXTERN void uv_unref(uv_handle_t *)
Definition: uv-common.c:522
uv_tcp_bind
UV_EXTERN int uv_tcp_bind(uv_tcp_t *handle, const struct sockaddr *addr, unsigned int flags)
Definition: uv-common.c:277
TEST_PORT
#define TEST_PORT
Definition: task.h:53
uv_close
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
Definition: unix/core.c:112
uv_stream_s
Definition: uv.h:491
client_ctx::client_handle
handle_storage_t client_handle
Definition: benchmark-multi-accept.c:76
uv_tcp_connect
UV_EXTERN int uv_tcp_connect(uv_connect_t *req, uv_tcp_t *handle, const struct sockaddr *addr, uv_connect_cb cb)
Definition: uv-common.c:315
uv_ip4_addr
UV_EXTERN int uv_ip4_addr(const char *ip, int port, struct sockaddr_in *addr)
Definition: uv-common.c:221
uv_idle_stop
UV_EXTERN int uv_idle_stop(uv_idle_t *idle)
uv_loop_close
UV_EXTERN int uv_loop_close(uv_loop_t *loop)
Definition: uv-common.c:761
ipc_client_ctx
Definition: benchmark-multi-accept.c:59
uv_default_loop
UV_EXTERN uv_loop_t * uv_default_loop(void)
Definition: uv-common.c:733
clients
static client_t clients[NUM_CLIENTS]
Definition: test-pipe-connect-multiple.c:40
uv_async_s
Definition: uv.h:834
ssize_t
intptr_t ssize_t
Definition: win.h:27
get_listen_handle
static void get_listen_handle(uv_loop_t *loop, uv_stream_t *server_handle)
Definition: benchmark-multi-accept.c:242
req
static uv_connect_t req
Definition: test-connection-fail.c:30
async_handle
static uv_async_t async_handle
Definition: test-async-null-cb.c:26
UV_RUN_DEFAULT
@ UV_RUN_DEFAULT
Definition: uv.h:254
ipc_client_ctx::ipc_pipe
uv_pipe_t ipc_pipe
Definition: benchmark-multi-accept.c:62
uint64_t
unsigned __int64 uint64_t
Definition: stdint-msvc2008.h:90
server_ctx::semaphore
uv_sem_t semaphore
Definition: benchmark-multi-accept.c:72
uv_read_start
UV_EXTERN int uv_read_start(uv_stream_t *, uv_alloc_cb alloc_cb, uv_read_cb read_cb)
Definition: unix/stream.c:1555
ipc_peer_ctx::peer_handle
handle_storage_t peer_handle
Definition: benchmark-multi-accept.c:55
server_handle
static uv_tcp_t server_handle
Definition: test-emfile.c:36
arg
Definition: cmdline.cc:40
uv_tcp_init
UV_EXTERN int uv_tcp_init(uv_loop_t *, uv_tcp_t *handle)
Definition: unix/tcp.c:143
uv_accept
UV_EXTERN int uv_accept(uv_stream_t *server, uv_stream_t *client)
Definition: unix/stream.c:591
uv_loop_init
UV_EXTERN int uv_loop_init(uv_loop_t *loop)
Definition: loop.c:30
ipc_close_cb
static void ipc_close_cb(uv_handle_t *handle)
Definition: benchmark-multi-accept.c:146
uv_thread_create
UV_EXTERN int uv_thread_create(uv_thread_t *tid, uv_thread_cb entry, void *arg)
Definition: libuv/src/unix/thread.c:209
ipc_read_cb
static void ipc_read_cb(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
Definition: benchmark-multi-accept.c:173
uv_sem_t
UV_PLATFORM_SEM_T uv_sem_t
Definition: unix.h:137
ipc_server_ctx::num_connects
unsigned int num_connects
Definition: benchmark-multi-accept.c:50
client_ctx::idle_handle
uv_idle_t idle_handle
Definition: benchmark-multi-accept.c:79
uv_tcp_s
Definition: uv.h:544
uv_sem_post
UV_EXTERN void uv_sem_post(uv_sem_t *sem)
Definition: libuv/src/unix/thread.c:669
peer_handle
static uv_tcp_t peer_handle
Definition: test-poll-oob.c:35
uv_sem_init
UV_EXTERN int uv_sem_init(uv_sem_t *sem, unsigned int value)
Definition: libuv/src/unix/thread.c:649
uv_idle_init
UV_EXTERN int uv_idle_init(uv_loop_t *, uv_idle_t *idle)
ipc_client_ctx::server_handle
uv_stream_t * server_handle
Definition: benchmark-multi-accept.c:61
test_tcp
static int test_tcp(unsigned int num_servers, unsigned int num_clients)
Definition: benchmark-multi-accept.c:362
uv.h
MAKE_VALGRIND_HAPPY
#define MAKE_VALGRIND_HAPPY()
Definition: task.h:229
ipc_alloc_cb
static void ipc_alloc_cb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
Definition: benchmark-multi-accept.c:163
uv_async_init
UV_EXTERN int uv_async_init(uv_loop_t *, uv_async_t *async, uv_async_cb async_cb)
Definition: unix/async.c:44
ipc_peer_ctx::write_req
uv_write_t write_req
Definition: benchmark-multi-accept.c:56
uv_buf_t
Definition: unix.h:121
NUM_CONNECTS
#define NUM_CONNECTS
Definition: benchmark-multi-accept.c:26
ipc_server_ctx::ipc_pipe
uv_pipe_t ipc_pipe
Definition: benchmark-multi-accept.c:51
server_ctx
Definition: benchmark-multi-accept.c:67
server_ctx::async_handle
uv_async_t async_handle
Definition: benchmark-multi-accept.c:70
sv_read_cb
static void sv_read_cb(uv_stream_t *handle, ssize_t nread, const uv_buf_t *buf)
Definition: benchmark-multi-accept.c:322
uv_idle_start
UV_EXTERN int uv_idle_start(uv_idle_t *idle, uv_idle_cb cb)
connect_req
static uv_connect_t connect_req
Definition: benchmark-tcp-write-batch.c:39
cl_connect_cb
static void cl_connect_cb(uv_connect_t *req, int status)
Definition: benchmark-multi-accept.c:330
uv_sem_destroy
UV_EXTERN void uv_sem_destroy(uv_sem_t *sem)
Definition: libuv/src/unix/thread.c:661
client_ctx::num_connects
unsigned int num_connects
Definition: benchmark-multi-accept.c:77
uv_idle_s
Definition: uv.h:824
uv_pipe_pending_type
UV_EXTERN uv_handle_type uv_pipe_pending_type(uv_pipe_t *handle)
Definition: unix/pipe.c:315
uv_hrtime
UV_EXTERN uint64_t uv_hrtime(void)
Definition: unix/core.c:107
ipc_write_cb
static void ipc_write_cb(uv_write_t *req, int status)
Definition: benchmark-multi-accept.c:139
BENCHMARK_IMPL
BENCHMARK_IMPL(tcp_multi_accept2)
Definition: benchmark-multi-accept.c:439
cl_close_cb
static void cl_close_cb(uv_handle_t *handle)
Definition: benchmark-multi-accept.c:344
arg
struct arg arg
send_listen_handles
static void send_listen_handles(uv_handle_type type, unsigned int num_servers, struct server_ctx *servers)
Definition: benchmark-multi-accept.c:203
uv_pipe_s
Definition: uv.h:757
uv_buf_init
UV_EXTERN uv_buf_t uv_buf_init(char *base, unsigned int len)
Definition: uv-common.c:157
sv_alloc_cb
static void sv_alloc_cb(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf)
Definition: benchmark-multi-accept.c:313
client_ctx::connect_req
uv_connect_t connect_req
Definition: benchmark-multi-accept.c:78
uv_write_s
Definition: uv.h:522
handle
static csh handle
Definition: test_arm_regression.c:16
uv_handle_s
Definition: uv.h:441
uv_thread_t
pthread_t uv_thread_t
Definition: unix.h:134
uv_loop_s
Definition: uv.h:1767
uv_close_cb
void(* uv_close_cb)(uv_handle_t *handle)
Definition: uv.h:316
uv_sem_wait
UV_EXTERN void uv_sem_wait(uv_sem_t *sem)
Definition: libuv/src/unix/thread.c:677
ipc_server_ctx::server_handle
handle_storage_t server_handle
Definition: benchmark-multi-accept.c:49
uv_write2
UV_EXTERN int uv_write2(uv_write_t *req, uv_stream_t *handle, const uv_buf_t bufs[], unsigned int nbufs, uv_stream_t *send_handle, uv_write_cb cb)
Definition: unix/stream.c:1393
asyncio_get_stats.type
type
Definition: asyncio_get_stats.py:37
uv_pipe_bind
UV_EXTERN int uv_pipe_bind(uv_pipe_t *handle, const char *name)
Definition: unix/pipe.c:43
stream_handle::pipe
uv_pipe_t pipe
Definition: benchmark-multi-accept.c:29
ipc_peer_ctx
Definition: benchmark-multi-accept.c:54
absl::status_internal::storage
static ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES absl::base_internal::AtomicHook< StatusPayloadPrinter > storage
Definition: abseil-cpp/absl/status/status_payload_printer.cc:26
client_handle
static uv_tcp_t client_handle
Definition: test-emfile.c:37
run_interop_tests.servers
servers
Definition: run_interop_tests.py:1288
i
uint64_t i
Definition: abseil-cpp/absl/container/btree_benchmark.cc:230
server_ctx::thread_id
uv_thread_t thread_id
Definition: benchmark-multi-accept.c:71
uv_async_send
UV_EXTERN int uv_async_send(uv_async_t *async)
Definition: unix/async.c:62


grpc
Author(s):
autogenerated on Thu Mar 13 2025 02:58:36