FunctionPackage: mpToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version


Arguments: process initial-function &rest initial-args

This function sets the initial function and arguments of process, then resets any computation in progress in it. This does not make process active if it was not already active.

process-preset will signal an error if process is an immigrant process.

process-preset is an extended operation that is not atomic in Allegro CL implementations. process-preset is implemented with a process-interrupt call that causes a throw past the current initial-function of the process. Another process-interrupt call, or any unwind-protect clauses in the current call chain can interrupt this throw and cancel or modify the effect of the process-preset. Therefore, only a cooperating process can be expected to complete a process-preset call in all cases. An application cannot assume that a process-preset will always be effective if the target process is not expecting it.


Process A:  (with-timeout (2 (do-something)) (work))

Process B: Calls (process-preset A 'foo) while A is in (work).

The timeout in A can interrupt a process-preset and leave A in do-something with the process-initial-function set to foo, but foo is never called.


Process B: 
  ;; Notify A that a process-preset is needed.
  (setf (getf (process-property-list A) 'preset-in-progress)
        (list 'foo))
  (process-preset A 'foo)

Process A:  
  (with-timeout (2
                 (let ((preset (getf (process-property-list 
                    (when preset 
		      ;; If a process-preset was interrupted by the 
		      ;; timeout, resume the process-preset operation.
                      (apply #'process-preset *current-process* preset)))

The above example is only an outline that illustrates the kind of action that must be taken. Additional interlocks and bookkeeping may be needed to make this solution totally bomb-proof.

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

Copyright (c) 1998-2015, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 10.0. This page was not revised from the 9.0 page.
Created 2015.5.21.

Allegro CL version 10.0
Unrevised from 9.0 to 10.0.
9.0 version