diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-05-16 15:20:30 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-05-16 15:20:30 +0200 |
commit | aa725ffd5bca2a5138aa4ef42f951a2e1525661f (patch) | |
tree | 3fbf43a68eedd41324bd3ebec6c7c11dce1a2b98 /doc | |
parent | fix nowait for polling + add nonblocking example (diff) | |
download | bus-aa725ffd5bca2a5138aa4ef42f951a2e1525661f.tar.gz bus-aa725ffd5bca2a5138aa4ef42f951a2e1525661f.tar.bz2 bus-aa725ffd5bca2a5138aa4ef42f951a2e1525661f.tar.xz |
add readme for nonblocking example
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | doc/examples/nonblocking/README | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/doc/examples/nonblocking/README b/doc/examples/nonblocking/README new file mode 100644 index 0000000..acd1b2c --- /dev/null +++ b/doc/examples/nonblocking/README @@ -0,0 +1,24 @@ +API usage example + +This example shows how to use bus_poll instead of bus_read, +and how to do non-blocking polling and non-blocking writing. + + + +First of, run make to build this example. + +To start the example run ./init. +When you are done run ./cleanup. + +Running instances of ./poll will check every second +if there is a new inbound message. Between these checks +./write will wait for all ./poll:s to receive the message. +This means that ./write blocks while ./poll sleeps. +If two or more instances of ./write is started at +approximately the same time, only one will continue to +write a message on the bus, the others will fail. + +./poll, ./init and ./cleanup are run without any +additional arguments. ./write is run with the message +as the second argument. + |