Lines Matching +full:multi +full:- +full:attr
1 // SPDX-License-Identifier: GPL-2.0
4 * sched-messaging.c
13 #include <subcmd/parse-options.h>
89 if (poll(&pollfd, 1, -1) != 1) in ready()
99 ready(ctx->ready_out, ctx->wakefd); in sender()
104 for (j = 0; j < ctx->num_fds; j++) { in sender()
108 ret = write(ctx->out_fds[j], data + done, in sender()
109 sizeof(data) - done); in sender()
128 close(ctx->in_fds[1]); in receiver()
131 ready(ctx->ready_out, ctx->wakefd); in receiver()
134 for (i = 0; i < ctx->num_packets; i++) { in receiver()
139 ret = read(ctx->in_fds[0], data + done, DATASIZE - done); in receiver()
153 pthread_attr_t attr; in create_thread_worker() local
156 if (pthread_attr_init(&attr) != 0) in create_thread_worker()
160 if (pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN) != 0) in create_thread_worker()
164 ret = pthread_create(&worker->thread, &attr, func, ctx); in create_thread_worker()
168 pthread_attr_destroy(&attr); in create_thread_worker()
175 worker->pid = fork(); in create_process_worker()
177 if (worker->pid == -1) { in create_process_worker()
179 } else if (worker->pid == 0) { in create_process_worker()
205 pthread_join(worker->thread, &thread_status); in reap_worker()
222 list_add(&snd_ctx->list, &sender_contexts); in group()
230 list_add(&ctx->list, &receiver_contexts); in group()
235 ctx->num_packets = num_fds * nr_loops; in group()
236 ctx->in_fds[0] = fds[0]; in group()
237 ctx->in_fds[1] = fds[1]; in group()
238 ctx->ready_out = ready_out; in group()
239 ctx->wakefd = wakefd; in group()
243 snd_ctx->out_fds[i] = fds[1]; in group()
250 snd_ctx->ready_out = ready_out; in group()
251 snd_ctx->wakefd = wakefd; in group()
252 snd_ctx->num_fds = num_fds; in group()
260 close(snd_ctx->out_fds[i]); in group()
281 "Be multi thread instead of multi process"),
363 list_del_init(&pos->list); in bench_sched_messaging()
367 list_del_init(&pos->list); in bench_sched_messaging()