From 3b03c4b2bcbcf5a913a3127d2b45283540c505c3 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Mon, 2 Apr 2018 08:19:54 +0200 Subject: ipcpd: Enable locking threads to a CPU core This adds a function that locks a thread to a random core. This greatly improves performance on multi-cpu systems. There is no portable way to do this, this only implements it for GNU/Linux. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/ipcpd/ipcp.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ipcpd/ipcp.h') diff --git a/src/ipcpd/ipcp.h b/src/ipcpd/ipcp.h index c81ea1aa..3771c1e4 100644 --- a/src/ipcpd/ipcp.h +++ b/src/ipcpd/ipcp.h @@ -138,4 +138,7 @@ uint8_t * ipcp_hash_dup(const uint8_t * hash); void ipcp_hash_str(char buf[], const uint8_t * hash); +/* Helper function to lock a thread to a core. */ +void ipcp_lock_to_core(void); + #endif /* OUROBOROS_IPCPD_IPCP_H */ -- cgit v1.2.3