The swank-crew Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The swank-crew Reference Manual

This is the swank-crew Reference Manual, version 1.3, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:23:41 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction


Swank Crew
==========

Swank Crew is a distributed computation framework written in Common Lisp that
uses Swank Client to evaluate forms on remote hosts.

Swank Crew works with Emacs and Slime to make developing distributed
applications easier.  Typically, you interactively develop code on a master
machine using Slime.  Code on the master uses the Swank Crew API to farm out
work to a gang of worker machines.  If code on a worker generates an exception,
a Slime stack trace window pops up and you can interactively debug the problem
using your existing Slime connection to the master.


The Swank Crew API
==================

connect-workers                 Create a worker pool containing a set of worker
                                Lisps.
disconnect-workers              Disconnect all the workers in a worker pool.
eval-form-all-workers           Evaluate a form on all the workers in a worker pool.
eval-form-repeatedly            Evaluate a form repeatedly on the workers in a pool
                                and collect the results on the master.
eval-repeatedly-async-state     Evaluate a form repeatedly on the workers in a pool
                                while asynchronously updating the workers' state.
parallel-mapcar                 Use the workers in a worker pool to evaluate a
                                function on all the elements of a list.
parallel-reduce                 Use the workers in a worker pool to evaluate a
                                function on all the elements of a list.  As results
                                return to the master, call a function repeatedly to
                                reduce them to one value.

For more information, see the documentation strings for the above functions in
master.lisp and the example code in swank-crew_test.lisp.


Installation
============

Swank Crew functions best when used with Slime.  In order to implement the
distributed Slime debugging features described above, you must patch swank.lisp
in the directory where you installed Slime:

    patch path/to/slime/swank.lisp swank.lisp-patch

The change to swank.lisp implements the forwarding of Swank protocol messages
from worker machines through the master's Swank server back to your Slime
client.  It's needed to debug problems on worker machines using your Slime
connection to the master.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 swank-crew

Author

Robert Brown

License

New BSD license. See the copyright messages in individual files.

Description

Distributed master/worker computing framework.

Long Description

Swank Crew is a framework for developing distributed master/worker applications. It uses Slime’s Swank protocol to transport data between machines, making the debugging of distributed applications easier.

Version

1.3

Dependencies
Source

swank-crew.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 swank-crew.asd

Location

swank-crew.asd

Systems

swank-crew (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 swank-crew/package.lisp

Parent

swank-crew (system)

Location

package.lisp

Packages

swank-crew


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 swank-crew/master.lisp

Dependency

package.lisp (file)

Parent

swank-crew (system)

Location

master.lisp

Exported Definitions
Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

3.1.4 swank-crew/worker.lisp

Dependency

package.lisp (file)

Parent

swank-crew (system)

Location

worker.lisp

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 swank-crew

Evaluate expressions on remote Lisps using the Swank protocol.

Source

package.lisp (file)

Use List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Special variables

Special Variable: *rex-port*
Package

swank-crew

Source

master.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Functions

Function: connect-workers HOST/PORT-ALIST

Makes Swank connections to all the workers in HOST/PORT-ALIST and returns a WORKER-POOL containing them. HOST/PORT-ALIST is a list of (host-name . port) pairs

Package

swank-crew

Source

master.lisp (file)

Function: disconnect-workers WORKER-POOL

Closes the Swank connections of all connected workers in WORKER-POOL.

Package

swank-crew

Source

master.lisp (file)

Function: eval-form-all-workers WORKER-POOL FORM &key RESULT-DONE REPLAY-REQUIRED

Evaluates FORM on all workers in WORKER-POOL. When RESULT-DONE is non-NIL, it must be a function of two arguments. In this case RESULT-DONE is called as each worker returns a result with two arguments, a non-negative integer representing the order in which the work was dispatched and the worker’s result. If REPLAY-REQUIRED is true, which is the default, FORM will be remembered and evaluated again for side effects on any new worker that joins POOL.

Package

swank-crew

Source

master.lisp (file)

Function: eval-form-repeatedly WORKER-POOL RESULT-COUNT FORM &key WORKER-COUNT

Evaluates FORM, which must return a function of no arguments, on WORKER-COUNT workers in WORKER-POOL, then arranges for the workers to repeatedly call the function to create RESULT-COUNT results, which are returned in a list. WORKER-COUNT defaults to the number of workers in WORKER-POOL.

Package

swank-crew

Source

master.lisp (file)

Function: eval-repeatedly-async-state WORKER-POOL FORM INITIAL-STATE UPDATE-STATE &key WORKER-COUNT

Evaluates FORM, which must return a function of one argument, on WORKER-COUNT workers in WORKER-POOL, then arranges for the workers to repeatedly call the work function and send its results back to the master. The work function is passed a state argument, initially set to INITIAL-STATE, that the master can update asynchronously as it receives new results.

On the master, the work state is initialized to INITIAL-STATE and UPDATE-STATE is called repeatedly to process results received from the workers. UPDATE-STATE is called with two arguments, the current work state and a list containing all unprocessed work results. UPDATE-STATE should return three values: the new work state, a boolean indicating whether the computation should end, and a boolean indicating whether the latest work state should be distributed to workers. When UPDATE-STATE’s second return value is true, EVAL-REPEATEDLY-ASYNC-STATE tells the workers to stop and returns the latest work state.

Package

swank-crew

Source

master.lisp (file)

Function: parallel-mapcar WORKER-POOL MAKE-WORK LIST &optional RESULT-DONE

Traverses LIST, calling MAKE-WORK on each element to create a form that is then passed to a remote worker in WORKER-POOL for evaluation. Results of evaluating each form are collected into a list, which is returned when every remote worker is done. If RESULT-DONE is provided, then it must be a function of two arguments. In this case RESULT-DONE is called on the master as each worker returns a result. The arguments to RESULT-DONE are the position of the work in LIST and the worker’s result.

Package

swank-crew

Source

master.lisp (file)

Function: parallel-reduce WORKER-POOL MAKE-WORK LIST INITIAL-VALUE REDUCER

Traverses LIST, calling MAKE-WORK on each element to create a form that is then passed to a remote worker in WORKER-POOL for evaluation. As results are returned, REDUCER, a binary function, is used to combine successive results in the manner of REDUCE. INITIAL-VALUE is used as the starting value for the reduction computation. The form

(parallel-reduce worker-pool make-work list initial-value reducer)

is equivalent to

(reduce reducer
(mapcar (lambda (x) (eval (funcall make-work x))) list) :initial-value initial-value)

Package

swank-crew

Source

master.lisp (file)

Function: worker-count WORKER-POOL

Returns the total number of workers in WORKER-POOL.

Package

swank-crew

Source

master.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Classes

Class: worker-pool ()

A pool of Swank workers to which Lisp forms can be sent for evaluation.

Package

swank-crew

Source

master.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: id

The worker pool’s ID.

Type

symbol

Initform

(gentemp (string-upcase (format nil "~a-~d-" (machine-instance) (osicat-posix:getpid))) "keyword")

Readers

id (generic function)

Slot: master-host-name

Host name of the master.

Type

string

Initform

(machine-instance)

Readers

master-host-name (generic function)

Slot: rex-port

Port number for Swank remote execution requests to the master.

Type

(or swank-crew::port null)

Initform

swank-crew:*rex-port*

Readers

rex-port (generic function)

Slot: workers

Vector containing all workers in the worker pool.

Type

vector

Initform

#()

Readers

workers (generic function)

Writers

(setf %workers) (generic function)

Slot: lock

Lock protecting IDLE-WORKERS, WORKER-AVAILABLE, and DISCONNECTING.

Initform

(bordeaux-threads:make-lock "worker pool")

Readers

lock (generic function)

Slot: idle-workers

List of currently idle workers.

Type

list

Initform

(quote nil)

Readers

idle-workers (generic function)

Writers

(setf idle-workers) (generic function)

Slot: worker-available

Condition signaled when a worker becomes idle.

Initform

(bordeaux-threads:make-condition-variable)

Readers

worker-available (generic function)

Slot: disconnecting

Set non-NIL when the worker pool is being torn down to tell the reconnector thread it should exit.

Readers

disconnecting (generic function)

Writers

(setf disconnecting) (generic function)

Slot: replay-forms-lock

Lock that protects REPLAY-FORMS.

Initform

(bordeaux-threads:make-lock "replay forms lock")

Readers

replay-forms-lock (generic function)

Slot: replay-forms

List containing all forms passed to EVAL-FORM-ALL-WORKERS that need to be replayed on new workers when they join the pool.

Type

list

Initform

(quote nil)

Readers

replay-forms (generic function)

Writers

(setf replay-forms) (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Constants

Constant: +worker-reconnect-interval+

Seconds between attempts to reconnect workers.

Package

swank-crew

Source

master.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Special variables

Special Variable: *evals*

List containing an EVALUATION instance for each running computation.

Package

swank-crew

Source

master.lisp (file)

Special Variable: *evals-lock*

Lock protecting access to *EVALS*.

Package

swank-crew

Source

master.lisp (file)

Special Variable: *evaluation-id*

Counter used to generate a unique ID for EVALUATION instances.

Package

swank-crew

Source

master.lisp (file)

Special Variable: *evaluation-id-lock*

Lock protecting access to *EVALUATION-ID*.

Package

swank-crew

Source

master.lisp (file)

Special Variable: *last-form-evaled*

The last form evaluated by the worker.

Package

swank-crew

Source

worker.lisp (file)

Special Variable: *last-random-state*

The value of *RANDOM-STATE* right before the worker started evaluating *LAST-FORM-EVALED*.

Package

swank-crew

Source

worker.lisp (file)

Special Variable: *last-repeated-eval-work-function*

Thunk created by the current invocation of REPEATEDLY-EVALUATE to produce results for an EVAL-FORM-REPEATEDLY request on the master. This variable is useful for debugging.

Package

swank-crew

Source

worker.lisp (file)

Special Variable: *replay-forms-counts*

Mapping from worker pool IDs to the number of replay forms we have evaluated on this client for that pool.

Package

swank-crew

Source

worker.lisp (file)

Special Variable: *replay-forms-counts-lock*

Lock protecting access to *REPLAY-FORMS-COUNTS*.

Package

swank-crew

Source

worker.lisp (file)

Special Variable: *worker-pools*

Mapping from worker pool IDs to active worker pools.

Package

swank-crew

Source

master.lisp (file)

Special Variable: *worker-pools-lock*

Lock protecting access to *WORKER-POOLS*.

Package

swank-crew

Source

master.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: add-eval EVAL

Adds EVAL to the list of in-progress computations.

Package

swank-crew

Source

master.lisp (file)

Function: add-evaluated-form WORKER-POOL FORM

Adds FORM to the set of forms that need to be evaluated on a new worker when it joins WORKER-POOL.

Package

swank-crew

Source

master.lisp (file)

Function: allocate-worker WORKER-POOL &key WORKER-TO-AVOID

Allocates and returns an idle worker from WORKER-POOL that is connected. If WORKER-POOL is being shut down, then NIL is returned.

Package

swank-crew

Source

master.lisp (file)

Function: allocate-worker-and-evaluate WORKER-POOL FORM SET-WORKER WORKER-DONE

Allocates a connected worker from WORKER-POOL and sends it FORM to evaluate. Returns the worker that was successfully allocated, or NIL if WORKER-POOL is shutting down. SET-WORKER is a function that is called to tell the WORKER-DONE continuation what worker is evaluating FORM.

Package

swank-crew

Source

master.lisp (file)

Function: async-evaluate FORM INITIAL-STATE ID MASTER-HOST-NAME MASTER-REX-PORT

Evaluates FORM, which must return a work function of one argument, then calls that function repeatedly to produce results, each time passing it the current computation state. At first this state is INITIAL-STATE, but the master may update the state asynchronously. Each work result is sent to the machine called MASTER-HOST-NAME by making a Swank connection to its MASTER-REX-PORT and remotely evaluating an expression that records the result. ID is used on the master machine to process results and on the worker to update the state.

Package

swank-crew

Source

worker.lisp (file)

Function: async-results-loop ASYNC-EVAL UPDATE-STATE

Handles incoming results for ASYNC-EVAL by calling UPDATE-STATE whenever ASYNC-EVAL holds unprocessed results. UPDATE-STATE is called with two arguments, the work state and a list of the unprocessed results.

Package

swank-crew

Source

master.lisp (file)

Function: async-work-form FORM INITIAL-STATE WORKER-POOL ID

Returns a form for evaluation on a client of WORKER-POOL that ensures the client is caught up and then evaluates FORM for the async evaluation request identified by ID.

Package

swank-crew

Source

master.lisp (file)

Function: catch-up-if-necessary MASTER-HOST-NAME MASTER-REX-PORT WORKER-POOL-ID POOL-COUNT

Ensures that the current client is up to date, that it has evaluated all POOL-COUNT replay forms associated with the pool identified by WORKER-POOL-ID. If it is necessary to evaluate forms in order to catch up, they are fetched by making a Swank connection to MASTER-REX-PORT on host MASTER-HOST-NAME.

Package

swank-crew

Source

worker.lisp (file)

Function: clear-debugging-info ()

Sets all debugging global variables to NIL.

Package

swank-crew

Source

worker.lisp (file)

Function: debugging-form FORM

Returns an expression that when evaluated returns the result of evaluating FORM. In addition, the returned expression arranges to update the values of *LAST-FORM-EVALED* and *LAST-RANDOM-STATE* for ease of debugging.

Package

swank-crew

Source

worker.lisp (file)

Function: dispatch-work WORKER-POOL MAKE-WORK LIST RESULT-DONE RETAIN-WORKERS REPLAY-REQUIRED

Traverses LIST, calling MAKE-WORK on each element to create a form that is then passed to a remote worker in WORKER-POOL for evaluation. When RETAIN-WORKERS is true, each form is evaluated on a unique worker. Otherwise, workers are reused and may process multiple forms. In either case, the results of evaluating each form are collected into a list, which is returned when every remote worker is done. If RESULT-DONE is not NIL, then it must be a function of two arguments. In this case RESULT-DONE is called on the master as each worker returns a result. The arguments to RESULT-DONE are an integer counter, indicating the work form’s position in LIST, and the result of evaluating the form. REPLAY-REQUIRED indicates whether new workers will have to perform the work generated by MAKE-WORK before being considered to be caught up.

Package

swank-crew

Source

master.lisp (file)

Function: ensure-caught-up-then-evaluate FORM WORKER-POOL REPLAY-REQUIRED

Returns a form that when evaluated on a worker in WORKER-POOL ensures that the worker is caught up then evaluates FORM and returns its result. REPLAY-REQUIRED indicates whether new workers must evaluate FORM before being considered to be caught up.

Package

swank-crew

Source

master.lisp (file)

Function: eval-on-master MAKE-WORK LIST RESULT-DONE

Iterates over the members of LIST calling MAKE-WORK on each one. If RESULT-DONE is not NIL, it must be a function of two arguments. In this case, after each application of MAKE-WORK to a LIST member, RESULT-DONE is called with the member’s position in LIST and MAKE-WORK’s result.

Package

swank-crew

Source

master.lisp (file)

Function: evaluate-form FORM MASTER-HOST-NAME MASTER-REX-PORT WORKER-POOL-ID POOL-COUNT REPLAY-REQUIRED

Evaluates FORM, but first ensures that this worker has evaluated all POOL-COUNT replay forms associated with the worker pool identified by WORKER-POOL-ID on the master. When catching up is required, fetches forms by making a Swank connection to MASTER-REX-PORT on host MASTER-HOST-NAME. REPLAY-REQUIRED indicates whether FORM may need to be replayed in order to bring a worker up to date.

Package

swank-crew

Source

worker.lisp (file)

Function: fetch-and-evaluate MASTER-HOST-NAME MASTER-REX-PORT WORKER-POOL-ID LOCAL-COUNT

Fetches from the master and then evaluates all forms required to catch up with other workers in the pool identified by WORKER-POOL-ID on the master. All replay forms after the first LOCAL-COUNT forms are fetched by making a Swank connection to MASTER-REX-PORT on host MASTER-HOST-NAME.

Package

swank-crew

Source

worker.lisp (file)

Function: find-eval ID

Returns the running EVAL instance identified by ID, or NIL if no computation with that ID is currently running.

Package

swank-crew

Source

master.lisp (file)

Function: find-worker-pool WORKER-POOL-ID

Returns the worker pool identified by WORKER-POOL-ID.

Package

swank-crew

Source

master.lisp (file)

Function: free-worker WORKER WORKER-POOL

Changes the state of WORKER to idle, so that it’s available for allocation.

Package

swank-crew

Source

master.lisp (file)

Function: handle-connection-closed DISCONNECTED-WORKER WORKER-POOL

Called when the connection to DISCONNECTED-WORKER, a member of WORKER-POOL, is closed because of a call to SLIME-CLOSE, the death of the worker, or because of a communications error. Moves all uncompleted work intended for DISCONNECTED-WORKER to another idle connected worker in WORKER-POOL.

Package

swank-crew

Source

master.lisp (file)

Function: make-worker-pool CONNECT-INFOS CONNECT-WORKER
Package

swank-crew

Source

master.lisp (file)

Function: no-workers-p WORKER-POOL

Returns T if WORKER-POOL is NIL or contains no workers.

Package

swank-crew

Source

master.lisp (file)

Function: reconnect-workers WORKER-POOL

Reconnects disconnected workers in WORKER-POOL.

Package

swank-crew

Source

master.lisp (file)

Function: record-async-result ID RESULT WORKER-STATE-COUNTER

Stores RESULT as one of the values produced by the async evaluation identified by ID. Returns a boolean indicating whether the worker should continue to call ASYNC-RESULT with additional results.

Package

swank-crew

Source

master.lisp (file)

Function: record-repeated-result ID RESULT

Stores RESULT as one of the values produced by the repeated evaluation identified by ID. Returns a boolean indicating whether the worker should continue to call RECORD-REPEATED-RESULT with additional results.

Package

swank-crew

Source

master.lisp (file)

Function: remove-eval EVAL

Removes EVAL from the list of in-progress computations.

Package

swank-crew

Source

master.lisp (file)

Function: repeated-work-form FORM WORKER-POOL ID

Returns a form for evaluation on a client of WORKER-POOL that ensures the client is caught up and then evaluates FORM for the repeated evaluation request identified by ID.

Package

swank-crew

Source

master.lisp (file)

Function: repeatedly-evaluate FORM ID MASTER-HOST-NAME MASTER-REX-PORT

Evaluates FORM, which must return a function of no arguments, then calls that function repeatedly to produce results. Each result is sent to the machine called MASTER-HOST-NAME by making a Swank connection to its MASTER-REX-PORT and remotely evaluating an expression that records the result. ID is used on the master machine to correctly record the result.

Package

swank-crew

Source

worker.lisp (file)

Function: send-many-results SEND-RESULT MASTER-HOST-NAME MASTER-REX-PORT

Creates a Slime connection to MASTER-HOST-NAME on port MASTER-REX-PORT, then repeatedly calls SEND-RESULT with the new connection as argument. Returns when SEND-RESULT returns NIL.

Package

swank-crew

Source

worker.lisp (file)

Function: unevaluated-replay-forms WORKER-POOL-ID EVALUATED-COUNT

For a worker that has executed EVALUATED-COUNT of the replay forms associated with the worker-pool identified by WORKER-POOL-ID, returns a list of the forms the worker needs to evaluate in order to be completely up to date.

Package

swank-crew

Source

master.lisp (file)

Function: worker-counts WORKER-POOL

Returns the number of idle, busy, and disconnected workers in WORKER-POOL. This function executes without locking WORKER-POOL, so it may return inconsistent information.

Package

swank-crew

Source

master.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Generic functions

Generic Function: (setf %workers) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: (setf %workers) NEW-VALUE (WORKER-POOL worker-pool)

Vector containing all workers in the worker pool.

Source

master.lisp (file)

Generic Function: connect-info OBJECT
Package

swank-crew

Methods
Method: connect-info (WORKER worker)

Information used when connecting to this worker.

Source

master.lisp (file)

Generic Function: connect-worker CONNECT-INFO CLOSE-HANDLER

Creates a connection to a worker’s Swank server using information in CONNECT-INFO. Passes the thunk CLOSE-HANDLER to SWANK-CLIENT:SLIME-CONNECT, so that it is invoked when the connection closes.

Package

swank-crew

Source

master.lisp (file)

Methods
Method: connect-worker (CONNECT-INFO connect-info) CLOSE-HANDLER
Generic Function: connection OBJECT
Generic Function: (setf connection) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: connection (WORKER worker)
Method: (setf connection) NEW-VALUE (WORKER worker)

When non-NIL, an open Swank connection to the worker.

Source

master.lisp (file)

Generic Function: disconnecting OBJECT
Generic Function: (setf disconnecting) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: disconnecting (WORKER-POOL worker-pool)
Method: (setf disconnecting) NEW-VALUE (WORKER-POOL worker-pool)

Set non-NIL when the worker pool is being torn down to tell the reconnector thread it should exit.

Source

master.lisp (file)

Generic Function: done OBJECT
Generic Function: (setf done) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: done (EVALUATION evaluation)
Method: (setf done) NEW-VALUE (EVALUATION evaluation)

Is the computation done?

Source

master.lisp (file)

Generic Function: done-condition OBJECT
Package

swank-crew

Methods
Method: done-condition (EVALUATION evaluation)

Condition variable notified when computation is done.

Source

master.lisp (file)

Generic Function: host-name OBJECT
Generic Function: (setf host-name) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: host-name (CONNECT-INFO connect-info)
Method: (setf host-name) NEW-VALUE (CONNECT-INFO connect-info)

Host the worker is running on.

Source

master.lisp (file)

Generic Function: id OBJECT
Package

swank-crew

Methods
Method: id (EVALUATION evaluation)

Unique ID for this running evaluation request.

Source

master.lisp (file)

Method: id (WORKER-POOL worker-pool)

The worker pool’s ID.

Source

master.lisp (file)

Generic Function: idle-workers OBJECT
Generic Function: (setf idle-workers) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: idle-workers (WORKER-POOL worker-pool)
Method: (setf idle-workers) NEW-VALUE (WORKER-POOL worker-pool)

List of currently idle workers.

Source

master.lisp (file)

Generic Function: lock OBJECT
Package

swank-crew

Methods
Method: lock (EVALUATION evaluation)

Lock protecting the access to this instance.

Source

master.lisp (file)

Method: lock (WORKER-POOL worker-pool)

Lock protecting IDLE-WORKERS, WORKER-AVAILABLE, and DISCONNECTING.

Source

master.lisp (file)

Method: lock (WORKER worker)

Lock protecting the mutable data of this worker.

Source

master.lisp (file)

Generic Function: master-host-name OBJECT
Package

swank-crew

Methods
Method: master-host-name (WORKER-POOL worker-pool)

Host name of the master.

Source

master.lisp (file)

Generic Function: port OBJECT
Generic Function: (setf port) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: port (CONNECT-INFO connect-info)
Method: (setf port) NEW-VALUE (CONNECT-INFO connect-info)

Port on which the worker’s Swank server is listening for connections.

Source

master.lisp (file)

Generic Function: reconnect-worker CONNECT-INFO CLOSE-HANDLER

Reconnects to a Swank server using information in CONNECT-INFO. Passes the thunk CLOSE-HANDLER to SWANK-CLIENT:SLIME-CONNECT, so that it is invoked when the connection closes.

Package

swank-crew

Source

master.lisp (file)

Methods
Method: reconnect-worker (CONNECT-INFO connect-info) CLOSE-HANDLER
Generic Function: replay-forms OBJECT
Generic Function: (setf replay-forms) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: replay-forms (WORKER-POOL worker-pool)
Method: (setf replay-forms) NEW-VALUE (WORKER-POOL worker-pool)

List containing all forms passed to EVAL-FORM-ALL-WORKERS that need to be replayed on new workers when they join the pool.

Source

master.lisp (file)

Generic Function: replay-forms-lock OBJECT
Package

swank-crew

Methods
Method: replay-forms-lock (WORKER-POOL worker-pool)

Lock that protects REPLAY-FORMS.

Source

master.lisp (file)

Generic Function: results OBJECT
Generic Function: (setf results) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: results (ASYNC-EVAL async-eval)
Method: (setf results) NEW-VALUE (ASYNC-EVAL async-eval)

List holding returned, but unprocessed, results.

Source

master.lisp (file)

Method: results (REPEATED-EVAL repeated-eval)

Vector holding returned results.

Source

master.lisp (file)

Generic Function: results-available OBJECT
Package

swank-crew

Methods
Method: results-available (ASYNC-EVAL async-eval)

Condition notified when new results are available.

Source

master.lisp (file)

Generic Function: results-position OBJECT
Generic Function: (setf results-position) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: results-position (REPEATED-EVAL repeated-eval)
Method: (setf results-position) NEW-VALUE (REPEATED-EVAL repeated-eval)

Position where the next result will be recorded.

Source

master.lisp (file)

Generic Function: rex-port OBJECT
Package

swank-crew

Methods
Method: rex-port (WORKER-POOL worker-pool)

Port number for Swank remote execution requests to the master.

Source

master.lisp (file)

Generic Function: set-worker OBJECT
Generic Function: (setf set-worker) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: set-worker (WORKER worker)
Method: (setf set-worker) NEW-VALUE (WORKER worker)

Function called to record which worker is evaluating a form.

Source

master.lisp (file)

Generic Function: state OBJECT
Generic Function: (setf state) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: state (ASYNC-EVAL async-eval)
Method: (setf state) NEW-VALUE (ASYNC-EVAL async-eval)

State of the asynchronous computation, updated from results.

Source

master.lisp (file)

Generic Function: state-counter OBJECT
Generic Function: (setf state-counter) NEW-VALUE OBJECT
Package

swank-crew

Methods
Method: state-counter (ASYNC-EVAL async-eval)
Method: (setf state-counter) NEW-VALUE (ASYNC-EVAL async-eval)

Counter incremented each time STATE is updated.

Source

master.lisp (file)

Generic Function: worker-available OBJECT
Package

swank-crew

Methods
Method: worker-available (WORKER-POOL worker-pool)

Condition signaled when a worker becomes idle.

Source

master.lisp (file)

Generic Function: workers OBJECT
Package

swank-crew

Methods
Method: workers (WORKER-POOL worker-pool)

Vector containing all workers in the worker pool.

Source

master.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Classes

Class: async-eval ()

Data needed to process incoming asynchronous evaluation results.

Package

swank-crew

Source

master.lisp (file)

Direct superclasses

evaluation (class)

Direct methods
Direct slots
Slot: results

List holding returned, but unprocessed, results.

Type

list

Initform

(quote nil)

Readers

results (generic function)

Writers

(setf results) (generic function)

Slot: results-available

Condition notified when new results are available.

Initform

(bordeaux-threads:make-condition-variable)

Readers

results-available (generic function)

Slot: state

State of the asynchronous computation, updated from results.

Initargs

:state

Readers

state (generic function)

Writers

(setf state) (generic function)

Slot: state-counter

Counter incremented each time STATE is updated.

Type

(integer 0)

Initform

0

Readers

state-counter (generic function)

Writers

(setf state-counter) (generic function)

Class: connect-info ()

Information needed when connecting to a worker’s Swank server.

Package

swank-crew

Source

master.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: host-name

Host the worker is running on.

Type

string

Initargs

:host-name

Readers

host-name (generic function)

Writers

(setf host-name) (generic function)

Slot: port

Port on which the worker’s Swank server is listening for connections.

Type

swank-crew::port

Initargs

:port

Readers

port (generic function)

Writers

(setf port) (generic function)

Class: evaluation ()

Stores the data needed to process incoming evaluation results.

Package

swank-crew

Source

master.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: id

Unique ID for this running evaluation request.

Type

integer

Initargs

:id

Initform

(bordeaux-threads:with-lock-held (swank-crew::*evaluation-id-lock*) (incf swank-crew::*evaluation-id*))

Readers

id (generic function)

Slot: lock

Lock protecting the access to this instance.

Initform

(bordeaux-threads:make-lock "evaluation")

Readers

lock (generic function)

Slot: done

Is the computation done?

Type

boolean

Readers

done (generic function)

Writers

(setf done) (generic function)

Slot: done-condition

Condition variable notified when computation is done.

Initform

(bordeaux-threads:make-condition-variable)

Readers

done-condition (generic function)

Class: repeated-eval ()

Stores the data needed to process an incoming repeated eval result.

Package

swank-crew

Source

master.lisp (file)

Direct superclasses

evaluation (class)

Direct methods
Direct slots
Slot: results

Vector holding returned results.

Type

simple-vector

Initargs

:results

Readers

results (generic function)

Slot: results-position

Position where the next result will be recorded.

Type

com.google.base:vector-index

Initform

0

Readers

results-position (generic function)

Writers

(setf results-position) (generic function)

Class: worker ()

A remote Lisp running a Swank server.

Package

swank-crew

Source

master.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: lock

Lock protecting the mutable data of this worker.

Initform

(bordeaux-threads:make-lock "worker")

Readers

lock (generic function)

Slot: connect-info

Information used when connecting to this worker.

Type

swank-crew::connect-info

Initargs

:connect-info

Readers

connect-info (generic function)

Slot: set-worker

Function called to record which worker is evaluating a form.

Type

function

Initform

(function identity)

Readers

set-worker (generic function)

Writers

(setf set-worker) (generic function)

Slot: connection

When non-NIL, an open Swank connection to the worker.

Type

(or null swank-client:swank-connection)

Readers

connection (generic function)

Writers

(setf connection) (generic function)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.6 Types

Type: port ()

A non-privileged TCP/IP port number.

Package

swank-crew

Source

master.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L   S  
Index Entry  Section

F
File, Lisp, swank-crew.asd: The swank-crew<dot>asd file
File, Lisp, swank-crew/master.lisp: The swank-crew/master<dot>lisp file
File, Lisp, swank-crew/package.lisp: The swank-crew/package<dot>lisp file
File, Lisp, swank-crew/worker.lisp: The swank-crew/worker<dot>lisp file

L
Lisp File, swank-crew.asd: The swank-crew<dot>asd file
Lisp File, swank-crew/master.lisp: The swank-crew/master<dot>lisp file
Lisp File, swank-crew/package.lisp: The swank-crew/package<dot>lisp file
Lisp File, swank-crew/worker.lisp: The swank-crew/worker<dot>lisp file

S
swank-crew.asd: The swank-crew<dot>asd file
swank-crew/master.lisp: The swank-crew/master<dot>lisp file
swank-crew/package.lisp: The swank-crew/package<dot>lisp file
swank-crew/worker.lisp: The swank-crew/worker<dot>lisp file

Jump to:   F   L   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   (  
A   C   D   E   F   G   H   I   L   M   N   P   R   S   U   W  
Index Entry  Section

(
(setf %workers): Internal generic functions
(setf %workers): Internal generic functions
(setf connection): Internal generic functions
(setf connection): Internal generic functions
(setf disconnecting): Internal generic functions
(setf disconnecting): Internal generic functions
(setf done): Internal generic functions
(setf done): Internal generic functions
(setf host-name): Internal generic functions
(setf host-name): Internal generic functions
(setf idle-workers): Internal generic functions
(setf idle-workers): Internal generic functions
(setf port): Internal generic functions
(setf port): Internal generic functions
(setf replay-forms): Internal generic functions
(setf replay-forms): Internal generic functions
(setf results): Internal generic functions
(setf results): Internal generic functions
(setf results-position): Internal generic functions
(setf results-position): Internal generic functions
(setf set-worker): Internal generic functions
(setf set-worker): Internal generic functions
(setf state): Internal generic functions
(setf state): Internal generic functions
(setf state-counter): Internal generic functions
(setf state-counter): Internal generic functions

A
add-eval: Internal functions
add-evaluated-form: Internal functions
allocate-worker: Internal functions
allocate-worker-and-evaluate: Internal functions
async-evaluate: Internal functions
async-results-loop: Internal functions
async-work-form: Internal functions

C
catch-up-if-necessary: Internal functions
clear-debugging-info: Internal functions
connect-info: Internal generic functions
connect-info: Internal generic functions
connect-worker: Internal generic functions
connect-worker: Internal generic functions
connect-workers: Exported functions
connection: Internal generic functions
connection: Internal generic functions

D
debugging-form: Internal functions
disconnect-workers: Exported functions
disconnecting: Internal generic functions
disconnecting: Internal generic functions
dispatch-work: Internal functions
done: Internal generic functions
done: Internal generic functions
done-condition: Internal generic functions
done-condition: Internal generic functions

E
ensure-caught-up-then-evaluate: Internal functions
eval-form-all-workers: Exported functions
eval-form-repeatedly: Exported functions
eval-on-master: Internal functions
eval-repeatedly-async-state: Exported functions
evaluate-form: Internal functions

F
fetch-and-evaluate: Internal functions
find-eval: Internal functions
find-worker-pool: Internal functions
free-worker: Internal functions
Function, add-eval: Internal functions
Function, add-evaluated-form: Internal functions
Function, allocate-worker: Internal functions
Function, allocate-worker-and-evaluate: Internal functions
Function, async-evaluate: Internal functions
Function, async-results-loop: Internal functions
Function, async-work-form: Internal functions
Function, catch-up-if-necessary: Internal functions
Function, clear-debugging-info: Internal functions
Function, connect-workers: Exported functions
Function, debugging-form: Internal functions
Function, disconnect-workers: Exported functions
Function, dispatch-work: Internal functions
Function, ensure-caught-up-then-evaluate: Internal functions
Function, eval-form-all-workers: Exported functions
Function, eval-form-repeatedly: Exported functions
Function, eval-on-master: Internal functions
Function, eval-repeatedly-async-state: Exported functions
Function, evaluate-form: Internal functions
Function, fetch-and-evaluate: Internal functions
Function, find-eval: Internal functions
Function, find-worker-pool: Internal functions
Function, free-worker: Internal functions
Function, handle-connection-closed: Internal functions
Function, make-worker-pool: Internal functions
Function, no-workers-p: Internal functions
Function, parallel-mapcar: Exported functions
Function, parallel-reduce: Exported functions
Function, reconnect-workers: Internal functions
Function, record-async-result: Internal functions
Function, record-repeated-result: Internal functions
Function, remove-eval: Internal functions
Function, repeated-work-form: Internal functions
Function, repeatedly-evaluate: Internal functions
Function, send-many-results: Internal functions
Function, unevaluated-replay-forms: Internal functions
Function, worker-count: Exported functions
Function, worker-counts: Internal functions

G
Generic Function, (setf %workers): Internal generic functions
Generic Function, (setf connection): Internal generic functions
Generic Function, (setf disconnecting): Internal generic functions
Generic Function, (setf done): Internal generic functions
Generic Function, (setf host-name): Internal generic functions
Generic Function, (setf idle-workers): Internal generic functions
Generic Function, (setf port): Internal generic functions
Generic Function, (setf replay-forms): Internal generic functions
Generic Function, (setf results): Internal generic functions
Generic Function, (setf results-position): Internal generic functions
Generic Function, (setf set-worker): Internal generic functions
Generic Function, (setf state): Internal generic functions
Generic Function, (setf state-counter): Internal generic functions
Generic Function, connect-info: Internal generic functions
Generic Function, connect-worker: Internal generic functions
Generic Function, connection: Internal generic functions
Generic Function, disconnecting: Internal generic functions
Generic Function, done: Internal generic functions
Generic Function, done-condition: Internal generic functions
Generic Function, host-name: Internal generic functions
Generic Function, id: Internal generic functions
Generic Function, idle-workers: Internal generic functions
Generic Function, lock: Internal generic functions
Generic Function, master-host-name: Internal generic functions
Generic Function, port: Internal generic functions
Generic Function, reconnect-worker: Internal generic functions
Generic Function, replay-forms: Internal generic functions
Generic Function, replay-forms-lock: Internal generic functions
Generic Function, results: Internal generic functions
Generic Function, results-available: Internal generic functions
Generic Function, results-position: Internal generic functions
Generic Function, rex-port: Internal generic functions
Generic Function, set-worker: Internal generic functions
Generic Function, state: Internal generic functions
Generic Function, state-counter: Internal generic functions
Generic Function, worker-available: Internal generic functions
Generic Function, workers: Internal generic functions

H
handle-connection-closed: Internal functions
host-name: Internal generic functions
host-name: Internal generic functions

I
id: Internal generic functions
id: Internal generic functions
id: Internal generic functions
idle-workers: Internal generic functions
idle-workers: Internal generic functions

L
lock: Internal generic functions
lock: Internal generic functions
lock: Internal generic functions
lock: Internal generic functions

M
make-worker-pool: Internal functions
master-host-name: Internal generic functions
master-host-name: Internal generic functions
Method, (setf %workers): Internal generic functions
Method, (setf connection): Internal generic functions
Method, (setf disconnecting): Internal generic functions
Method, (setf done): Internal generic functions
Method, (setf host-name): Internal generic functions
Method, (setf idle-workers): Internal generic functions
Method, (setf port): Internal generic functions
Method, (setf replay-forms): Internal generic functions
Method, (setf results): Internal generic functions
Method, (setf results-position): Internal generic functions
Method, (setf set-worker): Internal generic functions
Method, (setf state): Internal generic functions
Method, (setf state-counter): Internal generic functions
Method, connect-info: Internal generic functions
Method, connect-worker: Internal generic functions
Method, connection: Internal generic functions
Method, disconnecting: Internal generic functions
Method, done: Internal generic functions
Method, done-condition: Internal generic functions
Method, host-name: Internal generic functions
Method, id: Internal generic functions
Method, id: Internal generic functions
Method, idle-workers: Internal generic functions
Method, lock: Internal generic functions
Method, lock: Internal generic functions
Method, lock: Internal generic functions
Method, master-host-name: Internal generic functions
Method, port: Internal generic functions
Method, reconnect-worker: Internal generic functions
Method, replay-forms: Internal generic functions
Method, replay-forms-lock: Internal generic functions
Method, results: Internal generic functions
Method, results: Internal generic functions
Method, results-available: Internal generic functions
Method, results-position: Internal generic functions
Method, rex-port: Internal generic functions
Method, set-worker: Internal generic functions
Method, state: Internal generic functions
Method, state-counter: Internal generic functions
Method, worker-available: Internal generic functions
Method, workers: Internal generic functions

N
no-workers-p: Internal functions

P
parallel-mapcar: Exported functions
parallel-reduce: Exported functions
port: Internal generic functions
port: Internal generic functions

R
reconnect-worker: Internal generic functions
reconnect-worker: Internal generic functions
reconnect-workers: Internal functions
record-async-result: Internal functions
record-repeated-result: Internal functions
remove-eval: Internal functions
repeated-work-form: Internal functions
repeatedly-evaluate: Internal functions
replay-forms: Internal generic functions
replay-forms: Internal generic functions
replay-forms-lock: Internal generic functions
replay-forms-lock: Internal generic functions
results: Internal generic functions
results: Internal generic functions
results: Internal generic functions
results-available: Internal generic functions
results-available: Internal generic functions
results-position: Internal generic functions
results-position: Internal generic functions
rex-port: Internal generic functions
rex-port: Internal generic functions

S
send-many-results: Internal functions
set-worker: Internal generic functions
set-worker: Internal generic functions
state: Internal generic functions
state: Internal generic functions
state-counter: Internal generic functions
state-counter: Internal generic functions

U
unevaluated-replay-forms: Internal functions

W
worker-available: Internal generic functions
worker-available: Internal generic functions
worker-count: Exported functions
worker-counts: Internal functions
workers: Internal generic functions
workers: Internal generic functions

Jump to:   (  
A   C   D   E   F   G   H   I   L   M   N   P   R   S   U   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *   +  
C   D   H   I   L   M   P   R   S   W  
Index Entry  Section

*
*evals*: Internal special variables
*evals-lock*: Internal special variables
*evaluation-id*: Internal special variables
*evaluation-id-lock*: Internal special variables
*last-form-evaled*: Internal special variables
*last-random-state*: Internal special variables
*last-repeated-eval-work-function*: Internal special variables
*replay-forms-counts*: Internal special variables
*replay-forms-counts-lock*: Internal special variables
*rex-port*: Exported special variables
*worker-pools*: Internal special variables
*worker-pools-lock*: Internal special variables

+
+worker-reconnect-interval+: Internal constants

C
connect-info: Internal classes
connection: Internal classes
Constant, +worker-reconnect-interval+: Internal constants

D
disconnecting: Exported classes
done: Internal classes
done-condition: Internal classes

H
host-name: Internal classes

I
id: Exported classes
id: Internal classes
idle-workers: Exported classes

L
lock: Exported classes
lock: Internal classes
lock: Internal classes

M
master-host-name: Exported classes

P
port: Internal classes

R
replay-forms: Exported classes
replay-forms-lock: Exported classes
results: Internal classes
results: Internal classes
results-available: Internal classes
results-position: Internal classes
rex-port: Exported classes

S
set-worker: Internal classes
Slot, connect-info: Internal classes
Slot, connection: Internal classes
Slot, disconnecting: Exported classes
Slot, done: Internal classes
Slot, done-condition: Internal classes
Slot, host-name: Internal classes
Slot, id: Exported classes
Slot, id: Internal classes
Slot, idle-workers: Exported classes
Slot, lock: Exported classes
Slot, lock: Internal classes
Slot, lock: Internal classes
Slot, master-host-name: Exported classes
Slot, port: Internal classes
Slot, replay-forms: Exported classes
Slot, replay-forms-lock: Exported classes
Slot, results: Internal classes
Slot, results: Internal classes
Slot, results-available: Internal classes
Slot, results-position: Internal classes
Slot, rex-port: Exported classes
Slot, set-worker: Internal classes
Slot, state: Internal classes
Slot, state-counter: Internal classes
Slot, worker-available: Exported classes
Slot, workers: Exported classes
Special Variable, *evals*: Internal special variables
Special Variable, *evals-lock*: Internal special variables
Special Variable, *evaluation-id*: Internal special variables
Special Variable, *evaluation-id-lock*: Internal special variables
Special Variable, *last-form-evaled*: Internal special variables
Special Variable, *last-random-state*: Internal special variables
Special Variable, *last-repeated-eval-work-function*: Internal special variables
Special Variable, *replay-forms-counts*: Internal special variables
Special Variable, *replay-forms-counts-lock*: Internal special variables
Special Variable, *rex-port*: Exported special variables
Special Variable, *worker-pools*: Internal special variables
Special Variable, *worker-pools-lock*: Internal special variables
state: Internal classes
state-counter: Internal classes

W
worker-available: Exported classes
workers: Exported classes

Jump to:   *   +  
C   D   H   I   L   M   P   R   S   W  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   A   C   E   P   R   S   T   W  
Index Entry  Section

A
async-eval: Internal classes

C
Class, async-eval: Internal classes
Class, connect-info: Internal classes
Class, evaluation: Internal classes
Class, repeated-eval: Internal classes
Class, worker: Internal classes
Class, worker-pool: Exported classes
connect-info: Internal classes

E
evaluation: Internal classes

P
Package, swank-crew: The swank-crew package
port: Internal types

R
repeated-eval: Internal classes

S
swank-crew: The swank-crew system
swank-crew: The swank-crew package
System, swank-crew: The swank-crew system

T
Type, port: Internal types

W
worker: Internal classes
worker-pool: Exported classes

Jump to:   A   C   E   P   R   S   T   W