ADTast-experimentalpthread-emulation
Last change
on this file since a44514e was
32d1383,
checked in by Thierry Delisle <tdelisle@…>, 2 years ago
|
Committing http server when I know it works
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[137974ae] | 1 | #pragma once |
---|
| 2 | |
---|
| 3 | #include <stdint.h> |
---|
| 4 | |
---|
| 5 | #include <locks.hfa> |
---|
| 6 | #include <thread.hfa> |
---|
| 7 | |
---|
| 8 | extern const size_t zipf_sizes[]; |
---|
| 9 | enum { zipf_cnts = 36, }; |
---|
| 10 | |
---|
| 11 | struct sendfile_stats_t { |
---|
[ae020ea] | 12 | volatile uint64_t maxfd; |
---|
| 13 | volatile uint64_t close; |
---|
[32d1383] | 14 | volatile uint64_t error; |
---|
[137974ae] | 15 | volatile uint64_t calls; |
---|
[32d1383] | 16 | volatile uint64_t eagain; |
---|
[137974ae] | 17 | volatile uint64_t tries; |
---|
| 18 | volatile uint64_t header; |
---|
| 19 | volatile uint64_t splcin; |
---|
| 20 | volatile uint64_t splcot; |
---|
| 21 | struct { |
---|
| 22 | volatile uint64_t calls; |
---|
| 23 | volatile uint64_t bytes; |
---|
| 24 | } avgrd[zipf_cnts]; |
---|
| 25 | }; |
---|
| 26 | |
---|
| 27 | void ?{}( sendfile_stats_t & this ); |
---|
| 28 | |
---|
| 29 | void push(sendfile_stats_t & from, sendfile_stats_t & to); |
---|
| 30 | |
---|
| 31 | struct acceptor_stats_t { |
---|
| 32 | volatile uint64_t creates; |
---|
| 33 | volatile uint64_t accepts; |
---|
| 34 | volatile uint64_t eagains; |
---|
| 35 | }; |
---|
| 36 | |
---|
| 37 | void ?{}( acceptor_stats_t & this ); |
---|
| 38 | |
---|
| 39 | void push(acceptor_stats_t & from, acceptor_stats_t & to); |
---|
| 40 | |
---|
[329e26a] | 41 | struct ServerCluster { |
---|
| 42 | cluster self; |
---|
| 43 | processor * procs; |
---|
| 44 | }; |
---|
| 45 | |
---|
[137974ae] | 46 | thread StatsPrinter { |
---|
| 47 | struct { |
---|
| 48 | __spinlock_t lock; |
---|
| 49 | sendfile_stats_t send; |
---|
| 50 | acceptor_stats_t accpt; |
---|
| 51 | } stats; |
---|
| 52 | condition_variable(fast_block_lock) var; |
---|
[329e26a] | 53 | ServerCluster * cl; |
---|
[137974ae] | 54 | }; |
---|
| 55 | |
---|
[329e26a] | 56 | void ?{}( StatsPrinter & this, ServerCluster * cl ); |
---|
[137974ae] | 57 | void ^?{}( StatsPrinter & mutex this ); |
---|
| 58 | |
---|
| 59 | extern StatsPrinter * stats_thrd; |
---|
Note: See
TracBrowser
for help on using the repository browser.