diff options
Diffstat (limited to 'ipc')
-rw-r--r-- | ipc/ipc_thread.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ipc/ipc_thread.h b/ipc/ipc_thread.h index e8bfe4a..fbeea46 100644 --- a/ipc/ipc_thread.h +++ b/ipc/ipc_thread.h @@ -46,6 +46,11 @@ typedef thread_t ipc_thread_t; #define ith_lock(thread) simple_lock(&(thread)->ith_lock_data) #define ith_unlock(thread) simple_unlock(&(thread)->ith_lock_data) +/* + * Note that this isn't a queue, but rather a stack. This causes + * threads that were recently running to be reused earlier, which + * helps improve locality of reference. + */ typedef struct ipc_thread_queue { ipc_thread_t ithq_base; } *ipc_thread_queue_t; @@ -103,6 +108,7 @@ MACRO_BEGIN \ (thread)->ith_prev = _last; \ _first->ith_prev = (thread); \ _last->ith_next = (thread); \ + (queue)->ithq_base = (thread); \ } \ MACRO_END |