--- Gnu-Mach/ipc/ipc_thread.h 2020/09/02 04:36:56 1.1.1.1 +++ Gnu-Mach/ipc/ipc_thread.h 2020/09/02 04:45:04 1.1.1.2 @@ -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