âšī¸ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 3.2 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://www.lispworks.com/documentation/lw70/LW/html/lw-135.htm |
| Last Crawled | 2025-12-31 16:38:00 (3 months ago) |
| First Indexed | 2023-11-27 01:45:13 (2 years ago) |
| HTTP Status Code | 200 |
| Meta Title | 19.2 Processes basics |
| Meta Description | null |
| Meta Canonical | null |
| Boilerpipe Text | 19.2.3 Multiprocessing To start multiprocessing, use initialize-multiprocessing . This function does not return until multiprocessing has terminated. It is not necessary to use initialize-multiprocessing when the LispWorks environment is already running. Note that, on Windows, Mac OS X, Linux, x86/x64 Solaris and FreeBSD, the LispWorks images shipped do start the programming environment. If you create an image which does not start the programming environment, by using the :environment nil argument to save-image , then multiprocessing can be started in this new image as described below. 19.2.3.2 Multiprocessing on startup There are three ways to make a LispWorks executable start multiprocessing on startup. 1. Use the -multiprocessing command line argument 2. Save an image which starts multiprocessing by doing (save-image "mp-lispworks" :restart-function 'mp:initialize-multiprocessing) 3. Use delivery to create the executable and pass the argument :multiprocessing t to deliver . The delivery function will be called automatically in a new process. See the
LispWorks Delivery User Guide
for more details. LispWorks dynamic libraries always start multiprocessing on startup. See Multiprocessing in a dynamic library for more information. In all cases, *initial-processes* can be used to control which processes are created on startup, as described in Running your own processes on startup .
Note:
On Windows, Linux, x86/x64 Solaris, FreeBSD and Mac OS X you cannot save a LispWorks image with multiprocessing running. 19.2.3.3 Running your own processes on startup *initial-processes* is a list of lists. Each list is used by the system as a set of arguments to process-run-function . During initializing multiprocessing, the system does this: (dolist (x mp:*initial-processes*) (apply 'mp:process-run-function x)) This script saves a LispWorks image which starts multiprocessing on restart and runs a user-defined process. (load-all-patches) (load "my-server-code") (push '("Start Server" () start-my-server) mp:*initial-processes*) (save-image "my-server" :remarks "My Server" :restart-function 'mp:initialize-multiprocessing :environment nil) See save-image for a description of how to save an image. |
| Markdown | [All Manuals](https://www.lispworks.com/documentation/lw70/intro.htm) \> [LispWorks User Guide and Reference Manual](https://www.lispworks.com/documentation/lw70/LW/html/lw.htm) \> [19 Multiprocessing](https://www.lispworks.com/documentation/lw70/LW/html/lw-133.htm)
[](https://www.lispworks.com/documentation/lw70/LW/html/lw-136.htm)[](https://www.lispworks.com/documentation/lw70/LW/html/lw-134.htm)[](https://www.lispworks.com/documentation/lw70/LW/html/lw-133.htm)[](https://www.lispworks.com/documentation/lw70/LW/html/lw.htm)[](https://www.lispworks.com/documentation/lw70/LW/html/lw-2.htm#pgfId-1819613)[](https://www.lispworks.com/documentation/lw70/LW/html/lw-1432.htm)
### 19\.2 Processes basics
#### 19\.2.1 Creating a process
To create a new process, use [process-run-function](https://www.lispworks.com/documentation/lw70/LW/html/lw-977.htm#96518).
A process can exit either by returning from the process function or by calling [current-process-kill](https://www.lispworks.com/documentation/lw70/LW/html/lw-903.htm#13262).
#### 19\.2.2 Finding out about processes
The system initializes a number of processes on startup. These processes are specified by``[\*initial-processes\*](https://www.lispworks.com/documentation/lw70/LW/html/lw-918.htm#18630).
The current process is obtained by [get-current-process](https://www.lispworks.com/documentation/lw70/LW/html/lw-914.htm#30865). A list of all the current processes is returned by [list-all-processes](https://www.lispworks.com/documentation/lw70/LW/html/lw-920.htm#55433) and the number of them is returned by [processes-count](https://www.lispworks.com/documentation/lw70/LW/html/lw-997.htm#44826). The function [ps](https://www.lispworks.com/documentation/lw70/LW/html/lw-1000.htm#43017) is analogous to the UNIX command `ps`, and returns a list of the processes in the system, ordered by priority.
To find a process when you know its name, use [get-process](https://www.lispworks.com/documentation/lw70/LW/html/lw-915.htm#91897). To find the name, when you have the process, use [process-name](https://www.lispworks.com/documentation/lw70/LW/html/lw-969.htm#65666). The variable [\*process-initial-bindings\*](https://www.lispworks.com/documentation/lw70/LW/html/lw-961.htm#59591) specifies the variables that are initially bound in a process.
#### 19\.2.3 Multiprocessing
To start multiprocessing, use [initialize-multiprocessing](https://www.lispworks.com/documentation/lw70/LW/html/lw-917.htm#86604). This function does not return until multiprocessing has terminated.
It is not necessary to use [initialize-multiprocessing](https://www.lispworks.com/documentation/lw70/LW/html/lw-917.htm#86604) when the LispWorks environment is already running. Note that, on Windows, Mac OS X, Linux, x86/x64 Solaris and FreeBSD, the LispWorks images shipped do start the programming environment. If you create an image which does not start the programming environment, by using the `:environment nil` argument to [save-image](https://www.lispworks.com/documentation/lw70/LW/html/lw-602.htm#36980), then multiprocessing can be started in this new image as described below.
##### 19\.2.3.1 Starting multiprocessing interactively
You can call [initialize-multiprocessing](https://www.lispworks.com/documentation/lw70/LW/html/lw-917.htm#86604) from the REPL interface, which generates a default Listener process if no other processes are specified by [\*initial-processes\*](https://www.lispworks.com/documentation/lw70/LW/html/lw-918.htm#18630).
##### 19\.2.3.2 Multiprocessing on startup
There are three ways to make a LispWorks executable start multiprocessing on startup.
1\. Use the `-multiprocessing` command line argument
2\. Save an image which starts multiprocessing by doing
```
(save-image "mp-lispworks"
```
```
:restart-function 'mp:initialize-multiprocessing)
```
3\. Use delivery to create the executable and pass the argument `:multiprocessing t` to [deliver](https://www.lispworks.com/documentation/lw70/LW/html/lw-690.htm#44253). The delivery function will be called automatically in a new process. See the *LispWorks Delivery User Guide* for more details.
LispWorks dynamic libraries always start multiprocessing on startup. See [Multiprocessing in a dynamic library](https://www.lispworks.com/documentation/lw70/LW/html/lw-107.htm#49818) for more information.
In all cases, [\*initial-processes\*](https://www.lispworks.com/documentation/lw70/LW/html/lw-918.htm#18630) can be used to control which processes are created on startup, as described in [Running your own processes on startup](https://www.lispworks.com/documentation/lw70/LW/html/lw-135.htm#56209).
**Note:** On Windows, Linux, x86/x64 Solaris, FreeBSD and Mac OS X you cannot save a LispWorks image with multiprocessing running.
##### 19\.2.3.3 Running your own processes on startup
[\*initial-processes\*](https://www.lispworks.com/documentation/lw70/LW/html/lw-918.htm#18630) is a list of lists. Each list is used by the system as a set of arguments to [process-run-function](https://www.lispworks.com/documentation/lw70/LW/html/lw-977.htm#96518). During initializing multiprocessing, the system does this:
```
(dolist (x mp:*initial-processes*)
```
```
(apply 'mp:process-run-function x))
```
This script saves a LispWorks image which starts multiprocessing on restart and runs a user-defined process.
```
(load-all-patches)
```
```
(load "my-server-code")
```
```
(push '("Start Server" () start-my-server)
```
```
mp:*initial-processes*)
```
```
(save-image "my-server"
```
```
:remarks "My Server"
```
```
:restart-function 'mp:initialize-multiprocessing
```
```
:environment nil)
```
See [save-image](https://www.lispworks.com/documentation/lw70/LW/html/lw-602.htm#36980) for a description of how to save an image.
***
*LispWorks User Guide and Reference Manual - 13 Feb 2015*
[](https://www.lispworks.com/documentation/lw70/LW/html/lw-136.htm)[](https://www.lispworks.com/documentation/lw70/LW/html/lw-134.htm)[](https://www.lispworks.com/documentation/lw70/LW/html/lw-133.htm)[](https://www.lispworks.com/documentation/lw70/LW/html/lw.htm)[](https://www.lispworks.com/documentation/lw70/LW/html/lw-2.htm#pgfId-1819613)[](https://www.lispworks.com/documentation/lw70/LW/html/lw-1432.htm) |
| Readable Markdown | null |
| Shard | 73 (laksa) |
| Root Hash | 10912027089876509473 |
| Unparsed URL | com,lispworks!www,/documentation/lw70/LW/html/lw-135.htm s443 |