mirror of
https://github.com/troglobit/libuev.git
synced 2026-11-25 20:38:41 +00:00
Slight update before release.
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
6a40d51d26
commit
bfd046054b
2 files changed
+14
-6
No files matched your search
+1
-1
@@ -5,7 +5,7 @@ All notable changes to the project are documented in this file.
|
|||||||
|
|
||||||
|
|
||||||
[v1.1.0]
|
[v1.1.0]
|
||||||
------------
|
--------
|
||||||
|
|
||||||
Massively improved error handling.
|
Massively improved error handling.
|
||||||
|
|
||||||
|
|||||||
@@ -24,14 +24,14 @@ often swing without consideration. Event loops and non-blocking I/O is
|
|||||||
often a far easier approach, as well as less error prone.
|
often a far easier approach, as well as less error prone.
|
||||||
|
|
||||||
The purpose of many applications is, with a little logic sprinkled on
|
The purpose of many applications is, with a little logic sprinkled on
|
||||||
top, to act upon: network packets entering an interface, timeouts
|
top, to act on network packets entering an interface, timeouts expiring,
|
||||||
expiring, mouse clicks, or other types of events. Such applications are
|
mouse clicks, or other types of events. Such applications are often
|
||||||
often very well suited to use an event loop.
|
very well suited to use an event loop.
|
||||||
|
|
||||||
Applications that need to churn massively parallel algorithms are more
|
Applications that need to churn massively parallel algorithms are more
|
||||||
suitable for running multiple (independent) threads on several CPU
|
suitable for running multiple (independent) threads on several CPU
|
||||||
cores. However, threaded applications must deal with the side effects
|
cores. However, threaded applications must deal with the side effects
|
||||||
of concurrency, like: race conditions, deadlocks, live locks, etc.
|
of concurrency, like race conditions, deadlocks, live locks, etc.
|
||||||
Writing error free threaded applications is hard, debugging them can be
|
Writing error free threaded applications is hard, debugging them can be
|
||||||
even harder.
|
even harder.
|
||||||
|
|
||||||
@@ -111,6 +111,10 @@ 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`
|
||||||
the event loop returns immediately if no event is available.
|
the event loop returns immediately if no event is available.
|
||||||
|
|
||||||
|
In the case of errors, stream close, or peer shutdown libuEv handles
|
||||||
|
much internally, but also lets the callback run. This is useful for
|
||||||
|
stateful connections to be able to detect EOF.
|
||||||
|
|
||||||
Summary:
|
Summary:
|
||||||
|
|
||||||
1. Prepare an event context with `uev_init()`
|
1. Prepare an event context with `uev_init()`
|
||||||
@@ -123,7 +127,11 @@ Summary:
|
|||||||
bugs in event driven applications are due to sockets and files being
|
bugs in event driven applications are due to sockets and files being
|
||||||
opened in blocking mode. Be careful out there!
|
opened in blocking mode. Be careful out there!
|
||||||
|
|
||||||
**Note 2:** As mentioned above, a certain amount of care is needed when
|
**Note 2:** When closing a descriptor or socket, make sure to first stop
|
||||||
|
your watcher, if possible. This will help prevent any nasty side
|
||||||
|
effects on your program.
|
||||||
|
|
||||||
|
**Note 3:** As mentioned above, a certain amount of care is needed when
|
||||||
dealing with signalfd. This means that if your application, for
|
dealing with signalfd. This means that if your application, for
|
||||||
instance, uses `system()` you must redesign that to use `fork()`, and
|
instance, uses `system()` you must redesign that to use `fork()`, and
|
||||||
then in the child, unblock all signals blocked by your parent process,
|
then in the child, unblock all signals blocked by your parent process,
|
||||||
|
|||||||
Reference in new issue
Block a user