https://github.com/pallas/liboco
A simple cooperative multitasking event framework written in C++.
https://github.com/pallas/liboco
cooperative-multitasking event-driven linux ucontext
Last synced: about 1 year ago
JSON representation
A simple cooperative multitasking event framework written in C++.
- Host: GitHub
- URL: https://github.com/pallas/liboco
- Owner: pallas
- License: other
- Created: 2014-04-04T05:12:17.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2024-01-02T10:21:11.000Z (over 2 years ago)
- Last Synced: 2025-04-20T02:35:27.296Z (about 1 year ago)
- Topics: cooperative-multitasking, event-driven, linux, ucontext
- Language: C++
- Homepage:
- Size: 69.3 KB
- Stars: 1
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Deprecated
See
[ioucontext](https://github.com/pallas/ioucontext),
a coöperative multitasking library based on
[liburing](https://github.com/axboe/liburing)
and written in C.
======
# liboco
======
liboco is a simple cooperative multitasking event framework written in C++
as an exercise for the author. It is not meant as a replacement for
libpthread, libevent, libev, &c.
Requires
* [libace](https://github.com/pallas/libace)
* [libite](https://github.com/pallas/libite)
Based around ucontext and epoll, it is not currently intended to be
portable. In fact, it uses glibc extensions and Linux-specific system
calls, so it will probably only compile with that standard library and run
on a very modern kernel.
It is also not very safe regarding signals that are not processed via
signalfd. In particular, calling core::schedule or core::wait_for_* with
any pending signals that were not blocked when core::react was invoked are
likely to be handled at that time. Signal masks should not be modified from
within tasks.
It comes with the following example programs.
* rfc862d --- Echo server, bound to any IPv4 address on port 7.
* rfc862c --- Echo client, connects to 127.0.0.1 on port 7.
and
* open_fds --- Lists open FDs. When launched as a child, useful for
finding FD leaks in parent process.
While liboco is just a toy, the intention is to continue to add features and
hammer out some more interesting use-cases.