Changes in / [6a33e40:d3261710]
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
benchmark/io/http/Makefile.am
r6a33e40 rd3261710 21 21 include $(top_srcdir)/tools/build/cfa.make 22 22 23 AM_CFLAGS = -O 2-Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror23 AM_CFLAGS = -O3 -Wall -Wextra -I$(srcdir) -lrt -pthread # -Werror 24 24 AM_CFAFLAGS = -quiet -nodebug 25 25 AM_LDFLAGS = -quiet -nodebug -
benchmark/io/http/main.cfa
r6a33e40 rd3261710 1 #define _ _USE_GNU1 #define _GNU_SOURCE 2 2 3 3 #include <errno.h> … … 6 6 #include <unistd.h> 7 7 extern "C" { 8 #include <sched.h> 8 9 #include <signal.h> 9 10 #include <sys/socket.h> … … 67 68 (this.self){ "Server Cluster", options.clopts.params }; 68 69 70 cpu_set_t fullset; 71 CPU_ZERO(&fullset); 72 int ret = sched_getaffinity(getpid(), sizeof(fullset), &fullset); 73 if( ret != 0 ) abort | "sched_getaffinity failed with" | errno | strerror( errno ); 74 int cnt = CPU_COUNT(&fullset); 75 69 76 this.procs = alloc(options.clopts.nprocs); 70 77 for(i; options.clopts.nprocs) { 71 78 (this.procs[i]){ "Benchmark Processor", this.self }; 79 80 int c = 0; 81 int n = 1 + (i % cnt); 82 for(int j = 0; j < CPU_SETSIZE; j++) { 83 if(CPU_ISSET(j, &fullset)) n--; 84 if(n == 0) { 85 c = j; 86 break; 87 } 88 } 89 cpu_set_t localset; 90 CPU_ZERO(&localset); 91 CPU_SET(c, &localset); 92 ret = pthread_setaffinity_np(this.procs[i].kernel_thread, sizeof(localset), &localset); 93 if( ret != 0 ) abort | "sched_getaffinity failed with" | ret | strerror( ret ); 72 94 73 95 #if !defined(__CFA_NO_STATISTICS__) … … 146 168 int waited = 0; 147 169 for() { 148 ret = bind( server_fd, (struct sockaddr *)&address, sizeof(address) ); 170 int sockfd = server_fd; 171 __CONST_SOCKADDR_ARG addr; 172 addr.__sockaddr__ = (struct sockaddr *)&address; 173 socklen_t addrlen = sizeof(address); 174 ret = bind( sockfd, addr, addrlen ); 149 175 if(ret < 0) { 150 176 if(errno == EADDRINUSE) { -
libcfa/src/concurrency/kernel_private.hfa
r6a33e40 rd3261710 219 219 220 220 // Step 2 : acquire our local lock 221 /*paranoid*/ verify(!kernelTLS().sched_lock); 221 222 __atomic_acquire( &kernelTLS().sched_lock ); 222 223 /*paranoid*/ verify(kernelTLS().sched_lock); -
libcfa/src/concurrency/ready_queue.cfa
r6a33e40 rd3261710 201 201 uint_fast32_t ready_mutate_lock( void ) with(*__scheduler_lock) { 202 202 /* paranoid */ verify( ! __preemption_enabled() ); 203 /* paranoid */ verify( ! kernelTLS().sched_lock );204 203 205 204 // Step 1 : lock global lock … … 207 206 // to simply lock their own lock and enter. 208 207 __atomic_acquire( &write_lock ); 208 209 // Make sure we won't deadlock ourself 210 // Checking before acquiring the writer lock isn't safe 211 // because someone else could have locked us. 212 /* paranoid */ verify( ! kernelTLS().sched_lock ); 209 213 210 214 // Step 2 : lock per-proc lock
Note:
See TracChangeset
for help on using the changeset viewer.