ADTast-experimentalpthread-emulationqualifiedEnum
Last change
on this file since c8f5f7d 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 | |
---|
5 | extern "C" { |
---|
6 | #include <sys/socket.h> |
---|
7 | } |
---|
8 | |
---|
9 | //============================================================================================= |
---|
10 | // Worker Thread |
---|
11 | //============================================================================================= |
---|
12 | |
---|
13 | extern const size_t zipf_sizes[]; |
---|
14 | enum { zipf_cnts = 36, }; |
---|
15 | |
---|
16 | struct 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 | |
---|
28 | thread 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 | }; |
---|
39 | void ?{}( Worker & this); |
---|
40 | void main( Worker & ); |
---|
Note: See
TracBrowser
for help on using the repository browser.