Lisp Knowledgebase

Title: Process Priorities

ID: 10019

Product: LispWorks, LispWorks for Linux, LispWorks for Windows
Version: All
OS: All

Each process has a priority and can either be runnable, blocked or suspended.

If there is a runnable process with priority P, then no processes with priority less than P will run.

When there are runnable processes with equal priority, they will be scheduled in a round-robin manner.

If a process with priority P is running and a blocked process with priority greater than P becomes runnable, the second process will run when the scheduler is next invoked (either explicity or at the next preemption tick).

In order to change a process priority various internal data structures need to be updated. The best way to do this is to call MP:CHANGE-PROCESS-PRIORITY

(mp:change-process-priority proc-1 10)

An alternative way is to create the process with the desired priority by passing the :PRIORITY keyword to MP:PROCESS-RUN-FUNCTION.

(list (mp:process-run-function "SORTER-DOT" '(:priority 10) #'sorter #\.)
     (mp:process-run-function "SORTER-DASH" () #'sorter #\-))

See Also:

Summary:How does the process scheduler work?
Patch Enhancement#:

Company     Contact     Privacy Policy     Terms of Use