Loading kinetic-c.sublime-project +4 −4 Original line number Diff line number Diff line Loading @@ -40,10 +40,10 @@ "cmd": [ "make", "utility" "${file_base_name}" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build test utility", "name": "kinetic-c - Build and run system test", "working_dir": "${project_path}", "path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", }, Loading @@ -51,10 +51,10 @@ "cmd": [ "make", "${file_base_name}" "utility" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run system test", "name": "kinetic-c - Build test utility", "working_dir": "${project_path}", "path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", }, Loading src/lib/bus/sender.c +7 −5 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ #include "yacht.h" #include "sender_internal.h" #define MIN_DELAY 100 /* msec */ #define INFINITE_DELAY -1 /* poll will only return upon an event */ /* Offset for s->fds[0], which is the command pipe. */ #define CMD_FD (1) Loading Loading @@ -324,8 +327,7 @@ void *sender_mainloop(void *arg) { sender *self = (sender *)arg; assert(self); struct bus *b = self->bus; int delay = 1; int delay = MIN_DELAY; struct timeval tv; gettimeofday(&tv, NULL); Loading Loading @@ -379,10 +381,10 @@ void *sender_mainloop(void *arg) { } if (work) { delay = 1; } else { delay = MIN_DELAY; } else if (delay != INFINITE_DELAY) { delay <<= 1; if (delay > MAX_TIMEOUT) { delay = MAX_TIMEOUT; } if (delay > MAX_TIMEOUT) { delay = INFINITE_DELAY; } } } Loading src/lib/threadpool/threadpool.c +10 −8 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ #include "threadpool_internals.h" #define DEFAULT_MAX_DELAY 1000 /* msec */ #define MIN_DELAY 10 /* msec */ #define DEFAULT_MAX_DELAY 10000 /* msec */ #define INFINITE_DELAY -1 /* poll will only return upon an event */ #define DEFAULT_TASK_RINGBUF_SIZE2 8 #define DEFAULT_MAX_THREADS 8 Loading Loading @@ -289,21 +291,21 @@ static void *thread_task(void *arg) { size_t mask = t->task_ringbuf_mask; struct pollfd pfd[1] = { { .fd=ti->child_fd, .events=POLLIN }, }; uint8_t read_buf[NOTIFY_MSG_LEN]; size_t min_delay = 100; size_t delay = min_delay; size_t delay = MIN_DELAY; while (ti->status < STATUS_SHUTDOWN) { if (t->task_request_head == t->task_commit_head) { if (ti->status == STATUS_AWAKE) { if (delay > 1) { ti->status = STATUS_ASLEEP; } if (delay > MIN_DELAY) { ti->status = STATUS_ASLEEP; } } else { if (delay == 0) { delay = min_delay; delay = MIN_DELAY; } else { delay <<= 1; } if (delay > t->max_delay) { delay = t->max_delay; if ((size_t)delay > t->max_delay) { delay = INFINITE_DELAY; } } Loading @@ -316,7 +318,7 @@ static void *thread_task(void *arg) { break; } else if (pfd[0].revents & POLLIN) { if (ti->status == STATUS_ASLEEP) { ti->status = STATUS_AWAKE; } delay = min_delay; delay = MIN_DELAY; //SPIN_ADJ(t->active_threads, 1); ssize_t rres = read(ti->child_fd, read_buf, NOTIFY_MSG_LEN); if (rres < 0) { Loading Loading
kinetic-c.sublime-project +4 −4 Original line number Diff line number Diff line Loading @@ -40,10 +40,10 @@ "cmd": [ "make", "utility" "${file_base_name}" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build test utility", "name": "kinetic-c - Build and run system test", "working_dir": "${project_path}", "path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", }, Loading @@ -51,10 +51,10 @@ "cmd": [ "make", "${file_base_name}" "utility" ], "file_regex": "([A-Za-z][A-Za-z0-9/_]+\\.[ch])[:,] ?l?i?n?e? ?([0-9]+)[\\.:,]*([0-9]*)", "name": "kinetic-c - Build and run system test", "name": "kinetic-c - Build test utility", "working_dir": "${project_path}", "path": "/usr/local/bin:/usr/local/sbin:/usr/bin:/Users/greg/bin:~/.local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", }, Loading
src/lib/bus/sender.c +7 −5 Original line number Diff line number Diff line Loading @@ -36,6 +36,9 @@ #include "yacht.h" #include "sender_internal.h" #define MIN_DELAY 100 /* msec */ #define INFINITE_DELAY -1 /* poll will only return upon an event */ /* Offset for s->fds[0], which is the command pipe. */ #define CMD_FD (1) Loading Loading @@ -324,8 +327,7 @@ void *sender_mainloop(void *arg) { sender *self = (sender *)arg; assert(self); struct bus *b = self->bus; int delay = 1; int delay = MIN_DELAY; struct timeval tv; gettimeofday(&tv, NULL); Loading Loading @@ -379,10 +381,10 @@ void *sender_mainloop(void *arg) { } if (work) { delay = 1; } else { delay = MIN_DELAY; } else if (delay != INFINITE_DELAY) { delay <<= 1; if (delay > MAX_TIMEOUT) { delay = MAX_TIMEOUT; } if (delay > MAX_TIMEOUT) { delay = INFINITE_DELAY; } } } Loading
src/lib/threadpool/threadpool.c +10 −8 Original line number Diff line number Diff line Loading @@ -28,7 +28,9 @@ #include "threadpool_internals.h" #define DEFAULT_MAX_DELAY 1000 /* msec */ #define MIN_DELAY 10 /* msec */ #define DEFAULT_MAX_DELAY 10000 /* msec */ #define INFINITE_DELAY -1 /* poll will only return upon an event */ #define DEFAULT_TASK_RINGBUF_SIZE2 8 #define DEFAULT_MAX_THREADS 8 Loading Loading @@ -289,21 +291,21 @@ static void *thread_task(void *arg) { size_t mask = t->task_ringbuf_mask; struct pollfd pfd[1] = { { .fd=ti->child_fd, .events=POLLIN }, }; uint8_t read_buf[NOTIFY_MSG_LEN]; size_t min_delay = 100; size_t delay = min_delay; size_t delay = MIN_DELAY; while (ti->status < STATUS_SHUTDOWN) { if (t->task_request_head == t->task_commit_head) { if (ti->status == STATUS_AWAKE) { if (delay > 1) { ti->status = STATUS_ASLEEP; } if (delay > MIN_DELAY) { ti->status = STATUS_ASLEEP; } } else { if (delay == 0) { delay = min_delay; delay = MIN_DELAY; } else { delay <<= 1; } if (delay > t->max_delay) { delay = t->max_delay; if ((size_t)delay > t->max_delay) { delay = INFINITE_DELAY; } } Loading @@ -316,7 +318,7 @@ static void *thread_task(void *arg) { break; } else if (pfd[0].revents & POLLIN) { if (ti->status == STATUS_ASLEEP) { ti->status = STATUS_AWAKE; } delay = min_delay; delay = MIN_DELAY; //SPIN_ADJ(t->active_threads, 1); ssize_t rres = read(ti->child_fd, read_buf, NOTIFY_MSG_LEN); if (rres < 0) { Loading