iv_thread(3)
π iv_thread β ivykis thread convenience functions π
okay so bestie, this is iv_thread(3), from the ivykis programmer's manual, and it's literally the β¨threading helperβ¨ page. two little functions that make threads and ivykis play nice together. no cap, it's short but it's important.
β¨ NAME β¨
iv_thread_create, iv_thread_set_debug_state β ivykis thread convenience functions π§΅π
πΈ SYNOPSIS πΈ
#include <iv_thread.h>
int iv_thread_create(const char *name, void (*start_routine)(void *),
void *arg);
void iv_thread_set_debug_state(int state);
π¦ DESCRIPTION π¦
so like, iv_thread_create is basically a glow-up wrapper around pthread_create(3) π. it does the normal thread-making thing, BUT it also keeps an ivykis main loop reference alive in the calling thread for as long as the created thread is alive. and heads up: the calling thread must be an ivykis(3) thread, i.e. it has to have had iv_init(3) called in it. that's the vibe check, no exceptions π.
and why does it hold that reference, you ask? because holding a reference on the calling thread's ivykis event loop means the calling thread will not return from its ivykis main loop before the created thread exits π. and that matters so much, because if it did, cleanup that's still happening over in the created thread could get interrupted when the calling thread then goes and calls exit(3) π. so yeah, the reference is the whole point. it's giving protective bestie energy fr fr.
the tea on the new thread though: the created thread does not need to be an ivykis thread β¨. it can just be a regular thread doing regular thread things. iconic.
now, the debug mode π. if you call iv_thread_set_debug with a nonzero argument, it turns debugging ON, and then it prints a debug message to standard error every time:
- a thread gets created via
iv_thread_createπ£ - a thread that was created that way terminates πͺ¦
- destruction of such a thread gets signaled back to the calling thread π¬
so like, three whole moments. very thorough of it tbh.
one more thing, for the inter-thread signaling? iv_thread uses iv_event(3) π«Ά. that's just how it do.
π SEE ALSO π
and that's the whole page, bestie, you ate it πβ¨ this beauty is from ivykis, dated 2010-09-13, and it's page iv_thread(3) π go forth and thread responsibly, mwah π
π¦πΈ
π¦ where this page comes from
- alpine 3.22: ivykis-doc 0.43.2-r0 Β· LGPL-2.1-or-later
- alpine 3.23: ivykis-doc 0.43.2-r0 Β· LGPL-2.1-or-later
- alpine 3.24: ivykis-doc 0.43.2-r0 Β· LGPL-2.1-or-later
- debian bookworm: libivykis-dev 0.42.4-1
- debian trixie: libivykis-dev 0.43.2-1+b1
- epel 10: ivykis-devel 0.43.2-2.el10_0 Β· LicenseRef-Callaway-LGPLv2+
- epel 9: ivykis-devel 0.42.4-7.el9 Β· LGPLv2+
- fedora 43: ivykis-devel 0.43.2-4.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 43: ivykis-devel 0.43.2-4.fc43 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: ivykis-devel 0.43.2-5.fc44 Β· LicenseRef-Callaway-LGPLv2+
- fedora 44: ivykis-devel 0.43.2-5.fc44 Β· LicenseRef-Callaway-LGPLv2+
- nixpkgs unstable: libivykis 0.43.2
- opensuse-leap 16.0: ivykis-devel 0.43-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: ivykis-devel 0.43-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: ivykis-devel 0.43-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: ivykis-devel 0.43-bp160.1.12 Β· LGPL-2.1-only
- ubuntu jammy: libivykis-dev 0.42.4-1
- ubuntu noble: libivykis-dev 0.43-1build1
- ubuntu questing: libivykis-dev 0.43.2-1
- ubuntu resolute: libivykis-dev 0.43.2-1build1
- ubuntu stonking: libivykis-dev 0.43.2-1build1
- Copyright (C) 2010, 2013 Lennert Buytenhek
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms