Add notification queue to the async framework. (#40)
commit3b1cc8d569aef3becba24699e6c65bbfc0ef5f78
authorJiří Zárevúcky <zarevucky.jiri@gmail.com>
Thu, 14 Jun 2018 19:19:51 +0000 (14 21:19 +0200)
committerGitHub <noreply@github.com>
Thu, 14 Jun 2018 19:19:51 +0000 (14 21:19 +0200)
tree48831b6694741221da96c5070ed7d803bdd8037d
parent587478b2be4192b088f4a64c8fde7adeec10d4eb
Add notification queue to the async framework. (#40)

Instead of running notification handlers in the same fibril that received it,
forcing us to allocate a new fibril when the handler blocks, we instead queue
the notifications, and allow an arbitrary but fixed number of dedicated fibrils
handle them.

Although a service can increase the number of handler fibrils to reduce latency,
there are now no dynamic allocations due to received notifications.
When the same notification is received again while the older instance is still
in queue, the new notification overwrites the old and increments a counter
of received notifications.

The counter is currently unused, because passing it to the handler would
require extensive changes to user code, but it should be straightforward
to make use of it should the need arise.
uspace/lib/c/generic/async/server.c
uspace/lib/c/generic/fibril.c
uspace/lib/c/include/async.h
uspace/lib/c/include/fibril.h