Inspirel banner

Programming Distributed Systems with YAMI4

12.4 Doing The I/O Work

The core library does not create any threads on its own and therefore there is no background activity that could take care of generating the communication progress, neither at the sender nor at the receiver side.

All activity has to be driven by the application, which is supposed to ``lease'' one of its threads for doing the I/O work on behalf of the agent. This is achieved by calling the Do_Some_Work procedure in Ada or the do_some_work function in C++.

The ``do some work'' routine performs a single unit of work and returns to the caller. In a typical application it will be called in a tight loop.

It should be noted that it is this single function that drives all activity in the agent, including callback invocation. In other words, every callback is actually executed by the same thread that was provided by the application for the ``do some work'' call.