ivykis(3)
π NAME π
ivykis β bestie, it's a library for asynchronous I/O readiness notification β¨
π¦ DESCRIPTION π¦
okay so. ivykis is a library for asynchronous I/O readiness notification, and it lives in the ivykis programmer's manual π
It's basically a thin, portable wrapper around whatever mechanism your OS already ships, like epoll_create(2), kqueue(2), poll(2), poll(7d) (/dev/poll) and port_create(3C). So you write one vibe, and it slays on every platform π«Ά
ivykis was mainly designed for building high-performance network applications π but like, it can be used in any event-driven application that uses poll(2)able file descriptors as its event sources. no gatekeeping here π
so some programming models are all "block on I/O and spin up a whole thread per event source" and honestly? that's giving chaos π Programs written to the ivykis API are generally single-threaded (or use only a small number of threads), and they never block on I/O. All input and output is done in a nonblocking fashion, with I/O readiness notifications delivered via callback functions. that's the whole vibe β¨
The two main event sources in ivykis are file descriptors and timers π
- file descriptors generate an event when they become readable or writable or trigger an error condition
- timers generate an event when the system time increments past a certain pre-set time
Events associated with file descriptors are level-triggered β meaning a callback function set up to handle a certain file descriptor event will be called repeatedly until the condition generating the event has been cleared. she will keep showing up until you deal with her, periodt π
As mentioned, applications using ivykis are generally single-threaded. Event callbacks are strictly serialised within a thread, and non-preemptible. This mostly removes the need for locking of shared data, and generally simplifies writing applications. no mutex drama, we love to see it πβ¨
Each thread that uses ivykis has its own file descriptors and timers, and runs a separate event loop. everybody's got their own little ecosystem πΈ
In ivykis, all code that is not initialization code runs from callback functions. Callback functions are not allowed to block π« If a particular piece of code wants to perform a certain operation that can block, it either has to schedule it to run in a separate thread, or it has to perform the operation in a nonblocking fashion instead. For example:
- registering an input callback function instead of blocking on a
read - registering a timer instead of calling
sleep(2) - etc.
it's giving β¨main character energyβ¨, not β¨waiting in line energyβ¨ π§
π heads up bestie: in case of an internal error,ivykiswill useiv_fatal(3)to report the error. The application can provide a custom fatal error handler by callingiv_set_fatal_msg_handler(3). so if you wanna control how the meltdown looks, that's your moment π
π SEE ALSO π
and that's the whole page, bestie!! π«Ά this one is ivykis, dated 2010-08-15, from the ivykis source π go build something iconic with it πβ¨π
π¦ 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) 2003, 2010 Lennert Buytenhek
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms