source: benchmark/io/http/worker.hfa @ d24be37a

ADTast-experimentalpthread-emulationqualifiedEnum
Last change on this file since d24be37a was ef3c383, checked in by Thierry Delisle <tdelisle@…>, 3 years ago

Added statistics about sendfile in the webserver

  • Property mode set to 100644
File size: 820 bytes
Line 
1#pragma once
2
3#include <thread.hfa>
4
5extern "C" {
6        #include <sys/socket.h>
7}
8
9//=============================================================================================
10// Worker Thread
11//=============================================================================================
12
13extern const size_t zipf_sizes[];
14enum { zipf_cnts = 36, };
15
16struct sendfile_stats_t {
17        volatile uint64_t calls;
18        volatile uint64_t tries;
19        volatile uint64_t header;
20        volatile uint64_t splcin;
21        volatile uint64_t splcot;
22        struct {
23                volatile uint64_t calls;
24                volatile uint64_t bytes;
25        } avgrd[zipf_cnts];
26};
27
28thread Worker {
29        int pipe[2];
30        int sockfd;
31        struct sockaddr * addr;
32        socklen_t * addrlen;
33        int flags;
34        volatile bool done;
35        struct {
36                sendfile_stats_t sendfile;
37        } stats;
38};
39void ?{}( Worker & this);
40void main( Worker & );
Note: See TracBrowser for help on using the repository browser.