2003-08-19 06:44:58 +00:00
|
|
|
<?
|
|
|
|
require_once("docutil.php");
|
|
|
|
page_head("Core client: finite-state machine (FSM) structure");
|
|
|
|
echo "
|
2002-04-30 22:22:54 +00:00
|
|
|
<p>
|
2002-08-19 18:43:10 +00:00
|
|
|
The core client can perform many activities (file transfers,
|
|
|
|
computations, RPCs to scheduling servers) in parallel.
|
2004-03-21 00:10:15 +00:00
|
|
|
To manage this parallelism, the core client is structured as a number of
|
2002-08-19 18:43:10 +00:00
|
|
|
<b>finite-state machines</b> (FSM).
|
|
|
|
For example, an HTTP transaction is
|
2002-07-29 19:01:38 +00:00
|
|
|
represented by an FSM whose states might include:
|
|
|
|
</p>
|
2002-04-30 22:22:54 +00:00
|
|
|
<ul>
|
2002-08-19 18:43:10 +00:00
|
|
|
<li> Waiting for connection establishment.
|
|
|
|
<li> Waiting to send request header.
|
|
|
|
<li> Waiting to send send request body.
|
|
|
|
<li> Waiting for reply header.
|
|
|
|
<li> Waiting for reply body.
|
|
|
|
<li> Finished.
|
2002-04-30 22:22:54 +00:00
|
|
|
</ul>
|
|
|
|
<p>
|
2002-08-19 18:43:10 +00:00
|
|
|
FSMs of a particular type are managed by an <b>FSM container</b>.
|
2002-07-29 19:01:38 +00:00
|
|
|
Each FSM container manages a set of FSMs, and provides a <b>poll()</b>
|
2002-09-05 11:46:10 +00:00
|
|
|
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().
|
2002-04-30 22:22:54 +00:00
|
|
|
<p>
|
2002-08-19 18:43:10 +00:00
|
|
|
The core client uses the following FSM types:
|
2002-04-30 22:22:54 +00:00
|
|
|
<ul>
|
2002-08-19 18:43:10 +00:00
|
|
|
<li>
|
2002-08-20 23:54:17 +00:00
|
|
|
<b>NET_XFER</b> (container: <b>NET_XFER_SET</b>).
|
|
|
|
Each instance represents a network connection,
|
|
|
|
for which data is being transferred to/from memory or a disk file.
|
|
|
|
The <b>poll()</b> function uses
|
2002-07-29 19:01:38 +00:00
|
|
|
<b>select()</b> to manage the FSM without blocking.
|
2002-08-19 18:43:10 +00:00
|
|
|
<li>
|
2002-08-20 23:54:17 +00:00
|
|
|
<b>HTTP_OP</b> (container: <b>HTTP_OP_SET</b>).
|
|
|
|
Each instance represents an HTTP operation (GET, PUT or POST).
|
2002-08-19 18:43:10 +00:00
|
|
|
<li>
|
2002-08-20 23:54:17 +00:00
|
|
|
<b>FILE_XFER</b> (container: <b>FILE_XFER_SET</b>).
|
|
|
|
Each instance represents a file transfer (upload or download) in progress.
|
2002-08-19 18:43:10 +00:00
|
|
|
<li>
|
2002-08-20 23:54:17 +00:00
|
|
|
<b>PERS_FILE_XFER</b> (container: <b>PERS_FILE_XFER_SET</b>).
|
2003-08-19 06:44:58 +00:00
|
|
|
Each instance represents a 'persistent file transfer',
|
2002-08-20 23:54:17 +00:00
|
|
|
which recovers from server failures and disconnections,
|
|
|
|
and implements retry and give-up policies.
|
2002-09-05 11:46:10 +00:00
|
|
|
<li>
|
|
|
|
<b>SCHEDULER_OP</b>.
|
|
|
|
There is only one instance.
|
|
|
|
It encapsulates communication with scheduling servers,
|
|
|
|
including backoff and retry policies.
|
2002-08-20 23:54:17 +00:00
|
|
|
<li>
|
|
|
|
<b>ACTIVE_TASK</b> (container: <b>ACTIVE_TASK_SET</b>).
|
|
|
|
Each instance represents a running application.
|
2002-04-30 22:22:54 +00:00
|
|
|
</ul>
|
|
|
|
<p>
|
2002-08-19 18:43:10 +00:00
|
|
|
An FSM may be implemented using other FSMs; for example, FILE_XFER
|
2002-08-20 23:54:17 +00:00
|
|
|
is implemented using HTTP_OP, which in turn is implemented using NET_XFER.
|
2003-08-19 06:44:58 +00:00
|
|
|
";
|
|
|
|
page_tail();
|
|
|
|
?>
|