summaryrefslogtreecommitdiff
path: root/lib/thread.h
diff options
context:
space:
mode:
authorDenil Vira <denil@cumulusnetworks.com>2015-08-11 13:14:40 -0700
committerDenil Vira <denil@cumulusnetworks.com>2015-08-11 13:14:40 -0700
commit308d14aed909f6cfa9fb41d6db38b6418d9c76fc (patch)
treeea9ee41d3715b4bc48f8d2c25cadff3a64148b6b /lib/thread.h
parent610f23cfff4f323a8a82657ff670187ad714a0fb (diff)
Replace lists with arrays to store read and write threads
Ticket : CM-6300 Reviewed by : CCR-3049 Testing : Manual With arrays, a thread corresponding to given fd is looked up in constant time versus the linear time taken for list traversals.
Diffstat (limited to 'lib/thread.h')
-rw-r--r--lib/thread.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/thread.h b/lib/thread.h
index 95008a73bc..22eb7c7120 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -49,13 +49,14 @@ struct pqueue;
/* Master of the theads. */
struct thread_master
{
- struct thread_list read;
- struct thread_list write;
+ struct thread **read;
+ struct thread **write;
struct pqueue *timer;
struct thread_list event;
struct thread_list ready;
struct thread_list unuse;
struct pqueue *background;
+ int fd_limit;
fd_set readfd;
fd_set writefd;
fd_set exceptfd;