next up previous contents
Next: 4.1.9 Plug-ins Up: 4.1 Structure CM Previous: 4.1.7 Internal state   Contents

4.1.8 Compile servers

On Unix-like systems, CM supports parallel compilation. For computers connected using a LAN, this can be extended to distributed compilation using a network file system and the operating system's ``rsh'' facility. For a detailed discussion, see Section 12.

Sub-structure CM.Server provides access to and manipulation of compile servers. Each attached server is represented by a value of type CM.Server.server.


  structure Server : sig
    type server
    val start : { name: string,
                  cmd: string * string list,
                  pathtrans: (string -> string) option,
                  pref: int } -> server option
    val stop : server -> unit
    val kill : server -> unit
    val name : server -> string
  end

CM is put into ``parallel'' mode by attaching at least one compile server. Compile servers are attached using invocations of CM.Server.start. The function takes the name of the server (as an arbitrary string) ( name), the Unix command used to start the server in a form suitable as an argument to Unix.execute ( cmd), an optional ``path transformation function'' for converting local path names to remote pathnames ( pathtrans), and a numeric ``preference'' value that is used to choose servers at times when more than one is idle ( pref). The optional result is the handle representing the successfully attached server.

An existing server can be shut down and detached using CM.Server.stop or CM.Server.kill. The argument in either case must be the result of an earlier call of CM.Server.start. Function CM.Server.stop uses CM's master-slave protocol to instruct the server to shut down gracefully. Only if this fails it may become necessary to use CM.Server.kill, which will send a Unix TERM signal to destroy the server.

Given a server handle, function CM.Server.name returns the string that was originally given to the call of
CM.Server.start used to created the server.


next up previous contents
Next: 4.1.9 Plug-ins Up: 4.1 Structure CM Previous: 4.1.7 Internal state   Contents
Matthias Blume
2001-07-19