Changeset 7f0ac12 for benchmark/io/http/worker.hfa
- Timestamp:
- Jun 8, 2022, 7:07:51 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- bbf61838
- Parents:
- 6e2b04e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/worker.hfa
r6e2b04e r7f0ac12 1 1 #pragma once 2 2 3 #include <iofwd.hfa> 4 #include <queueLockFree.hfa> 3 5 #include <thread.hfa> 4 6 … … 26 28 }; 27 29 28 thread Worker { 30 void ?{}( sendfile_stats_t & this ); 31 32 struct connection { 29 33 int pipe[2]; 34 struct { 35 sendfile_stats_t sendfile; 36 } stats; 37 }; 38 39 static inline void ?{}( connection & this ) { 40 this.pipe[0] = -1; 41 this.pipe[1] = -1; 42 } 43 44 thread AcceptWorker { 45 connection conn; 30 46 int sockfd; 31 47 struct sockaddr * addr; … … 33 49 int flags; 34 50 volatile bool done; 51 }; 52 void ?{}( AcceptWorker & this); 53 void main( AcceptWorker & ); 54 55 56 struct PendingRead { 57 PendingRead * volatile next; 58 io_future_t f; 35 59 struct { 36 sendfile_stats_t sendfile; 37 } stats; 60 void * buf; 61 size_t len; 62 } in; 63 struct { 64 volatile int fd; 65 } out; 38 66 }; 39 void ?{}( Worker & this); 40 void main( Worker & ); 67 68 static inline PendingRead * volatile & ?`next ( PendingRead * node ) { 69 return node->next; 70 } 71 72 thread ChannelWorker { 73 connection conn; 74 volatile bool done; 75 mpsc_queue(PendingRead) * queue; 76 }; 77 void ?{}( ChannelWorker & ); 78 void main( ChannelWorker & ); 79 80 thread Acceptor { 81 mpsc_queue(PendingRead) * queue; 82 int sockfd; 83 struct sockaddr * addr; 84 socklen_t * addrlen; 85 int flags; 86 volatile bool done; 87 }; 88 void ?{}( Acceptor & ); 89 void main( Acceptor & );
Note: See TracChangeset
for help on using the changeset viewer.