Function | Package: mp | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version

## make-process

Arguments: &key name class reset-action run-reasons arrest-reasons priority quantum resume-hook suspend-hook initial-bindings run-immediately stack-allocation message-interrupt-function

This function returns a new process object, but does nothing about making it runnable.

#### name, class, quantum, priority, run-reasons, arrest-reasons, and reset-action keyword arguments

name must be a string. Its default value is "Anonymous".

The class keyword argument specifies the class of the process being created. The value defaults to the class `mp:process`. A subclass of `mp:process` may be specified instead, if a program has created such subclasses.

The default value of quantum is 2 and of priority is 0. run-reasons and arrest-reasons are both lists of Lisp objects. They default to `nil` (that is, the empty list). The effect of these lists being empty or not is described in multiprocessing.htm. The process can run only if the arrest-reasons list is empty, and the run-reasons list is not empty. reset-action defaults to `nil`. If it is set to `t`, the process will restart if it is reset or ever completes; that is, it will once again apply its initial function to its initial arguments. Otherwise, the process will be killed when it completes.

#### No property-list keyword argument

There is no property-list keyword argument, but property lists for processes are supported and process-property-list accesses them. They can be modified in the usual property list way with getf and setf of getf and that function.

#### initial-bindings, resume-hook, and suspend-hook keyword arguments

The initial-bindings, resume-hook, and suspend-hook arguments all default to `nil` and initialize the corresponding slot values of the process object. The meanings of these slots are explained in multiprocessing.htm.

#### stack-allocation keyword argument

The stack-allocation argument is only used in the :os-threads model of multiprocessing. It specifies the size to request from the OS for the thread associated with the new process. The default value is to copy the size used for the process in which the process-creating function (i.e. make-process or something that calls make-process) is running. A process's soft limit is set to a default value when the process starts. This value is 80% of the hard limit or 4 megabytes, whichever is less.

#### message-interrupt-function keyword argument

The message-interrupt-function argument is important for Windows only. In the windows environment only, it's very very bad to ignore messages for long periods of time. Some global events involve broadcasting messages to a class of threads, and some of these have to be responded to or things lock up.

To deal with this, each windows process has an attribute process-message-interrupt-function. When a process is in a non-ready state (wait function, arrest reasons, no run reasons), and a windows message appears on its message queue, then the `process-message-interrupt-function` will be run as if by process-interrupt call, if the process-message-interrupt-function is non-`nil`.

The `process-message-interrupt-function` attribute can be initialized at process creation via the message-interrupt-function keyword argument. The default value, if unspecified, is the value (at process-creation time) of the variable `mp:*default-message-interrupt-function*`.

    (mp:process-message-interrupt-function p) is setfable.

The function specified as the message-interrupt handler for a process must return non-`nil` if there is any chance that it made a change in Lisp state that could free another process to run, and `nil` otherwise.

The system-provided initial value of `*default-message-interrupt-function*` is the function mp::process-messages-in-interrupt, a function of no arguments, that verifies the existance of messages on the queue. It returns `nil` if there are none. Otherwise it dispatches all of them and returns `t`.

#### The immigrant and run-immediately keyword arguments

The immigrant keyword argument is for internal use only. Do not specify a value for it.

The run-immediately keyword argument was designed to tell the in-Lisp scheduler to run the new process immediately (assuming it was runnable) regardless of the assigned priorities. It was never effective in threaded multiprocessing since scheduling was done by the OS. In 7.0 it is ignored and no value should be specified for it.

See multiprocessing.htm for general information on multiprocessing in Allegro CL.

Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

|  | ToC | DocOverview | CGDoc | RelNotes | FAQ | Index | PermutedIndex
| Allegro CL version 10.1 Unrevised from 10.0 to 10.1. 10.0 version