Finite State Machine Structure
From Unofficial BOINC Wiki
[edit] General
The BOINC Client Software can perform many activities (file transfers, computations, RPCs to Scheduling Servers) in parallel. To manage this parallelism, the BOINC Client Software is structured as a number of Finite-State Machines (FSM). For example, an HTTP transaction is represented by an FSM whose states might include:
- Waiting for connection establishment.
- Waiting to send request header.
- Waiting to send send request body.
- Waiting for reply header.
- Waiting for reply body.
- Finished.
Finite-State Machines of a particular type are managed by an Finite-State Machine Container. Each FSM Container manages a set of FSMs, and provides a poll() function for detecting and performing state transitions. These functions are nonblocking; at the lowest level, they must use non-blocking network sockets, accessed using select().
The BOINC Client Software uses the following FSM types:
- NET_XFER (container: NET_XFER_SET). Each instance represents a network connection, for which data is being transferred to/from memory or a disk file. The poll() function uses select() to manage the FSM without blocking.
- HTTP_OP (container: HTTP_OP_SET). Each instance represents an HTTP Operation (GET, PUT or POST).
- FILE_XFER (container: FILE_XFER_SET). Each instance represents a file transfer (upload or download) in progress.
- PERS_FILE_XFER (container: PERS_FILE_XFER_SET). Each instance represents a 'persistent file transfer', which recovers from server failures and disconnections, and implements retry and give-up policies.
- SCHEDULER_OP. There is only one instance. It encapsulates communication with scheduling servers, including backoff and retry policies.
- ACTIVE_TASK (container: ACTIVE_TASK_SET). Each instance represents a running application.
A Finite-State Machine may be implemented using other Finite-State Machine; for example, FILE_XFER is implemented using HTTP_OP, which in turn is implemented using NET_XFER.
[edit] UCB Source
[edit] Copyright ©
- 2005 University of California
- 2005 Paul D. Buck
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.

