mirror of
https://github.com/troglobit/libuev.git
synced 2026-12-04 22:08:31 +00:00
README.md: Last update, possibly. Mostly tweaks and cleanup.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
e50f8aee94
commit
3094ef2887
1 file changed
+7
-7
@@ -1,7 +1,7 @@
|
|||||||
libuEv | Simple event loop for Linux
|
libuEv | Simple event loop for Linux
|
||||||
====================================
|
====================================
|
||||||
|
|
||||||
> "Why an event loop, why not use threads?"
|
> “Why an event loop, why not use threads?”
|
||||||
|
|
||||||
With the advent of light-weight processes (threads) programmers these
|
With the advent of light-weight processes (threads) programmers these
|
||||||
days have a [golden hammer](http://c2.com/cgi/wiki?GoldenHammer) they
|
days have a [golden hammer](http://c2.com/cgi/wiki?GoldenHammer) they
|
||||||
@@ -27,7 +27,7 @@ in mind, however, that not all systems your application will run on have
|
|||||||
multiple CPU cores -- some small embedded systems still use a single CPU
|
multiple CPU cores -- some small embedded systems still use a single CPU
|
||||||
core, even though they run Linux, with multiple threads a program may
|
core, even though they run Linux, with multiple threads a program may
|
||||||
actually run slower! Always profile your program, and if possible, test
|
actually run slower! Always profile your program, and if possible, test
|
||||||
it on several different architectures.
|
it on different architectures.
|
||||||
|
|
||||||
LibuEv is a simple event loop in the style of the more established
|
LibuEv is a simple event loop in the style of the more established
|
||||||
[libevent](http://libevent.org/),
|
[libevent](http://libevent.org/),
|
||||||
@@ -86,7 +86,7 @@ callback to the event context by passing the `uev_ctx_t` variable, along
|
|||||||
with an `uev_t` variable to each event's `_init()` function.
|
with an `uev_t` variable to each event's `_init()` function.
|
||||||
|
|
||||||
When all watchers are registered call the event loop with `uev_run()`
|
When all watchers are registered call the event loop with `uev_run()`
|
||||||
and the argument to the event context. The flags parameter is slightly
|
and the argument to the event context. The `flags` parameter is slightly
|
||||||
mysterious, but can be used to integrate libuEv into another event loop.
|
mysterious, but can be used to integrate libuEv into another event loop.
|
||||||
With `flags` set to `UEV_ONCE` the event loop returns after having
|
With `flags` set to `UEV_ONCE` the event loop returns after having
|
||||||
served the first event. If `flags` is set to `UEV_ONCE | UEV_NONBLOCK`
|
served the first event. If `flags` is set to `UEV_ONCE | UEV_NONBLOCK`
|
||||||
@@ -101,8 +101,8 @@ Summary:
|
|||||||
4. Leave the event loop with `uev_exit()`, possibly from a callback
|
4. Leave the event loop with `uev_exit()`, possibly from a callback
|
||||||
|
|
||||||
**Note:** Make sure to use non-blocking stream I/O! Most hard to find
|
**Note:** Make sure to use non-blocking stream I/O! Most hard to find
|
||||||
bugs in event driven applications is due to file descriptors and
|
bugs in event driven applications is due to file descriptors and sockets
|
||||||
sockets being opened in blocking mode. Be careful out there!
|
being opened in blocking mode. Be careful out there!
|
||||||
|
|
||||||
|
|
||||||
Example
|
Example
|
||||||
@@ -209,10 +209,10 @@ Size of libuEv:
|
|||||||
Origin & References
|
Origin & References
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
LibuEv was originally based on
|
LibuEv (this library) was originally based on
|
||||||
[LibUEvent](http://code.google.com/p/libuevent/) by
|
[LibUEvent](http://code.google.com/p/libuevent/) by
|
||||||
[Flemming Madsen](http://www.madsensoft.dk/) but has been completely
|
[Flemming Madsen](http://www.madsensoft.dk/) but has been completely
|
||||||
rewritten and is now more similar to the famous
|
rewritten with a much clearer API. Now more similar to the famous
|
||||||
[libev](http://software.schmorp.de/pkg/libev.html) by Mark Lehmann.
|
[libev](http://software.schmorp.de/pkg/libev.html) by Mark Lehmann.
|
||||||
Another small event library used for inspiration is the very small
|
Another small event library used for inspiration is the very small
|
||||||
[Picoev](https://github.com/kazuho/picoev) by
|
[Picoev](https://github.com/kazuho/picoev) by
|
||||||
|
|||||||
Reference in new issue
Block a user