Lines Matching refs:wi

139     nxt_worker_info_t  *wi;  in cas_worker()  local
142 wi = p; in cas_worker()
148 ++wi->cas; in cas_worker()
159 nxt_worker_info_t *wi; in faa_worker() local
162 wi = p; in faa_worker()
166 wi->faa++; in faa_worker()
176 nxt_worker_info_t *wi; in enq_deq_worker() local
179 wi = p; in enq_deq_worker()
185 nxt_cq_enqueue(&q->active_queue, wi->id); in enq_deq_worker()
186 wi->enq++; in enq_deq_worker()
193 wi->deq++; in enq_deq_worker()
195 if ((int) v == wi->id) { in enq_deq_worker()
196 wi->own_res++; in enq_deq_worker()
208 nxt_worker_info_t *wi; in enq_worker() local
211 wi = p; in enq_worker()
218 wi->enq++; in enq_worker()
229 nxt_worker_info_t *wi; in deq_worker() local
232 wi = p; in deq_worker()
239 ++wi->deq; in deq_worker()
250 nxt_worker_info_t *wi; in wenq_worker() local
253 wi = p; in wenq_worker()
258 wi->wait_enq++; in wenq_worker()
264 wi->enq++; in wenq_worker()
265 wi->wait_enq--; in wenq_worker()
275 nxt_worker_info_t *wi; in wdeq_worker() local
278 wi = p; in wdeq_worker()
283 wi->wait_deq++; in wdeq_worker()
289 wi->deq++; in wdeq_worker()
290 wi->wait_deq--; in wdeq_worker()
296 worker_create(nxt_worker_info_t *wi, int id, nxt_thread_start_t start) in worker_create() argument
298 wi->id = id; in worker_create()
306 link->work.data = wi; in worker_create()
308 return nxt_thread_create(&wi->handle, link); in worker_create()
314 start(wi); in worker_create()
318 wi->pid = pid; in worker_create()
327 worker_wait(nxt_worker_info_t *wi) in worker_wait() argument
330 pthread_join(wi->handle, NULL); in worker_wait()
333 waitpid(wi->pid, &wi->status, 0); in worker_wait()
349 nxt_worker_info_t *wi; in main() local
448 wi = mmap(NULL, nprocs * sizeof(nxt_worker_info_t), PROT_READ | PROT_WRITE, in main()
450 if (wi == MAP_FAILED) { in main()
455 nxt_memzero(wi, nprocs * sizeof(nxt_worker_info_t)); in main()
469 worker_create(wi + id, id, enq_worker); in main()
473 worker_create(wi + id, id, deq_worker); in main()
477 worker_create(wi + id, id, wenq_worker); in main()
481 worker_create(wi + id, id, wdeq_worker); in main()
485 worker_create(wi + id, id, enq_deq_worker); in main()
489 worker_create(wi + id, id, cas_worker); in main()
493 worker_create(wi + id, id, faa_worker); in main()
497 worker_wait(wi + j); in main()
503 wi[0].enq += wi[j].enq; in main()
504 wi[0].deq += wi[j].deq; in main()
505 wi[0].wait_enq += wi[j].wait_enq; in main()
506 wi[0].wait_deq += wi[j].wait_deq; in main()
507 wi[0].own_res += wi[j].own_res; in main()
508 wi[0].cas += wi[j].cas; in main()
509 wi[0].faa += wi[j].faa; in main()
512 total_ops = wi[0].enq + wi[0].deq + wi[0].cas + wi[0].faa; in main()
522 printf("enq %10"PRIu64"\n", wi[0].enq); in main()
523 printf("deq %10"PRIu64"\n", wi[0].deq); in main()
524 printf("wait_enq %10"PRIu64"\n", wi[0].wait_enq); in main()
525 printf("wait_deq %10"PRIu64"\n", wi[0].wait_deq); in main()
526 printf("own_res %10"PRIu64"\n", wi[0].own_res); in main()
527 printf("cas %10"PRIu64"\n", wi[0].cas); in main()
528 printf("faa %10"PRIu64"\n", wi[0].faa); in main()