mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-08 16:10:59 +00:00
Update README
This commit is contained in:
1 parent
bccd32a7ee
commit
ed22e88c81
1 file changed
+14
-10
@@ -1,14 +1,21 @@
|
|||||||
libuev - Micro event loop library
|
libuev - Micro event loop library
|
||||||
=================================
|
=================================
|
||||||
|
|
||||||
The libuev library is a small event library in the style of the
|
The libuev library is a small event library in the style of libevent,
|
||||||
venerable Xt(3) event loop.
|
the excellent libev and the venerable Xt(3) event loop.
|
||||||
|
|
||||||
Basically an event context is created and handlers for timers and I/O
|
It is heavily modelled after the libev API, but will never be as
|
||||||
stream events can be registered with this context.
|
portable or friendly to older systems. The focus of this project is
|
||||||
|
modern embedded Linux systems, you will need kernel and C-library
|
||||||
|
support for epoll(7) and timerfd.
|
||||||
|
|
||||||
After initial setup, the typical application will enter the event loop
|
|
||||||
that will only return at program termination.
|
Usage
|
||||||
|
-----
|
||||||
|
|
||||||
|
Basically an event context is created to which timer and I/O stream
|
||||||
|
watchers are registered. After initial setup, the typical application
|
||||||
|
enters the event loop that will only return at program termination.
|
||||||
|
|
||||||
|
|
||||||
The C API
|
The C API
|
||||||
@@ -18,7 +25,7 @@ The typical application will do the following steps
|
|||||||
|
|
||||||
1. Create the event context with `uev_ctx_create()`
|
1. Create the event context with `uev_ctx_create()`
|
||||||
2. Register callbacks with `uev_io_create()` and `uev_timer_create()`
|
2. Register callbacks with `uev_io_create()` and `uev_timer_create()`
|
||||||
3. Enter the event loop with uev_run()
|
3. Enter the event loop with `uev_run()`
|
||||||
|
|
||||||
**Note:** Make sure to use non-blocking stream I/O!
|
**Note:** Make sure to use non-blocking stream I/O!
|
||||||
|
|
||||||
@@ -41,6 +48,3 @@ Warning
|
|||||||
Please be advised, libuev is not thread safe! It is primarily intended
|
Please be advised, libuev is not thread safe! It is primarily intended
|
||||||
for use-cases where the engineed wants to avoid the use of threads.
|
for use-cases where the engineed wants to avoid the use of threads.
|
||||||
|
|
||||||
However, if you insist on trying to use libuev with threads, the `uev_t`
|
|
||||||
structure needs mutex protection against simultaneous access.
|
|
||||||
|
|
||||||
Reference in new issue
Block a user