aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-07-14 13:19:10 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-07-14 13:19:10 +0300
commit06cd3ac67f9e039219df21d4bf63bf53b666355a (patch)
treeca4b62aee1deb9465737c0635747a5a42f704baf /include
parent39175324e152b6b1e905cd45ecec31e4b667ebea (diff)
downloadkmi-06cd3ac67f9e039219df21d4bf63bf53b666355a.tar.gz
kmi-06cd3ac67f9e039219df21d4bf63bf53b666355a.zip
expose max number of concurrent threads to users
+ Can be used to build fast hashmaps to speed up ipc
Diffstat (limited to 'include')
-rw-r--r--include/kmi/syscalls.h9
-rw-r--r--include/kmi/tcb.h5
2 files changed, 14 insertions, 0 deletions
diff --git a/include/kmi/syscalls.h b/include/kmi/syscalls.h
index 5079d74..4319812 100644
--- a/include/kmi/syscalls.h
+++ b/include/kmi/syscalls.h
@@ -258,6 +258,15 @@ enum conf_param {
* \c R
*/
CONF_PAGE_SIZE,
+
+ /**
+ * Maximum number of threads active at the same time.
+ * Can be used by userspace to build a pretty fast hashmaps of thread
+ * IDs to whatever, see \ref get_tcb().
+ * Guaranteed to be some power of 2.
+ * \c R
+ */
+ CONF_MAX_THREADS,
};
/** Capabilities of process. */
diff --git a/include/kmi/tcb.h b/include/kmi/tcb.h
index a6522f8..4214cb0 100644
--- a/include/kmi/tcb.h
+++ b/include/kmi/tcb.h
@@ -199,6 +199,11 @@ struct tcb {
void init_tcbs();
/**
+ * @return Maximum number of threads active at the same time.
+ */
+size_t max_tcbs();
+
+/**
* Destroy thread control subsystem.
*/
void destroy_tcbs();