From aa725ffd5bca2a5138aa4ef42f951a2e1525661f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 16 May 2015 15:20:30 +0200 Subject: add readme for nonblocking example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- doc/examples/nonblocking/README | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 doc/examples/nonblocking/README (limited to 'doc/examples/nonblocking/README') 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. + -- cgit v1.2.3-70-g09d2