aboutsummaryrefslogblamecommitdiffstats
path: root/doc/examples/timed/README
blob: 8293758704541e13296091e11745c6a61a3723e0 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                      


                                                   


                                                     






                                                        
 
                                                        


                                                     
API usage example

This example shows how to use timed operations.



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 wait for new messages
continuously, but with one second timeouts.

./slow-poll works like ./poll, execpt it will sleep
for one second every time it receives a message.

Running instances of ./read will read for ten seconds
then time out.

./poll, ./read, and ./slow-poll will stop if the message
"stop" is broadcasted.

./write will wait for atmost a tenth of a seconds before
failing. This means that if two instances of ./write is
started at the same time one of them will fail if
./slow-poll is running.

./poll, ./read, ./init and ./cleanup are run without any
additional arguments. ./write is run with the message
as the second argument.