Skip to content
Karsten Poeck edited this page Jun 19, 2022 · 1 revision

MP

Definition Index

  • MP

      No documentation provided.
      • EXTERNAL SPECIAL-VARIABLE
            No documentation provided.
          • EXTERNAL CLASS
                No documentation provided.
              • EXTERNAL CLASS
                    No documentation provided.
                  • EXTERNAL CLASS
                        No documentation provided.
                      • EXTERNAL CLASS
                            No documentation provided.
                          • EXTERNAL CLASS
                                No documentation provided.
                              • EXTERNAL CONDITION
                                    No documentation provided.
                                  • EXTERNAL CONDITION
                                        Superclass of errors relating to processes.
                                      • EXTERNAL CONDITION
                                            PROCESS-JOIN signals a condition of this type when the thread being joined ended abnormally.
                                          • EXTERNAL FUNCTION
                                              • MAYBE-CONDITION
                                              Internal function; use ABORT-PROCESS instead.Immediately end the current process abnormally. If PROCESS-JOIN is called on this process thereafter, it will signal an error of type PROCESS-JOIN-ERROR with the given condition (or NIL) attached.
                                            • EXTERNAL FUNCTION
                                                • &OPTIONAL
                                                • DATUM
                                                • &REST
                                                • ARGUMENTS
                                                Source
                                                Immediately end the current process abnormally.
                                                If PROCESS-JOIN is called on this process thereafter, it will signal an error of type PROCESS-JOIN-ERROR.
                                                If DATUM is provided, it and ARGUMENTS designate a condition of default type SIMPLE-ERROR. This condition will be attached to the PROCESS-JOIN-ERROR.
                                              • EXTERNAL FUNCTION
                                                    Return a list of all processes that have been enabled and have not yet exited, i.e. all active and suspended processes.
                                                  • EXTERNAL FUNCTION
                                                        No documentation provided.
                                                      • EXTERNAL FUNCTION
                                                          • CV
                                                          Notify all threads currently waiting on the given condition variableIf no threads are waiting on it, there is no effect. Return no values.
                                                        • EXTERNAL FUNCTION
                                                            • THIS
                                                            Source
                                                            No documentation provided.
                                                          • EXTERNAL FUNCTION
                                                              • CV
                                                              Notify at least one thread that is currently waiting on the given condition variable (i.e. wake it up)If no threads are waiting on it, there is no effect. Return no values.
                                                            • EXTERNAL FUNCTION
                                                                • CV
                                                                • MUTEX
                                                                • TIMEOUT_SECONDS
                                                                Like CONDITION-VARIABLE-WAIT, except that a timeout (in seconds) may be provided.
                                                              • EXTERNAL FUNCTION
                                                                  • CV
                                                                  • MUTEX
                                                                  Wait on the given condition variable with the given mutexIn more detail: The mutex must already be held by this thread. Then, atomically, the mutex is released and this thread blocks on the condition variable (i.e. execution will not continue).\n\nLater, the thread will resume and obtain the mutex again. Ideally this will be when the process is properly notified (see below), but occasionally the thread may resume spuriously, so make sure to check that the condition is actually true after this function returns.
                                                                • EXTERNAL FUNCTION
                                                                      No documentation provided.
                                                                    • EXTERNAL FUNCTION
                                                                        • &REST
                                                                        • VALUES
                                                                        Immediately end the current processThe arguments to this function are returned from any PROCESS-JOIN calls with the current process as argument. Does not return.)doc")
                                                                        DOCGROUP(clasp
                                                                      • EXTERNAL FUNCTION
                                                                          • PLACE
                                                                          • &REST
                                                                          • KEYS
                                                                          • &KEY
                                                                          • ENVIRONMENT
                                                                          • ORDER
                                                                          • &ALLOW-OTHER-KEYS
                                                                          Source
                                                                          Analogous to GET-SETF-EXPANSION. Returns the following seven values:
                                                                          * a list of temporary variables, which will be bound as if by LET*
                                                                          * a list of forms, whose results will be bound to the variables
                                                                          * a variable for the old value of PLACE, for use in CAS
                                                                          * a variable for the new value of PLACE, for use in CAS and SETF
                                                                          * a form to atomically read the value of PLACE
                                                                          * a form to atomically write the value of PLACE
                                                                          * a form to perform an atomic EQ-based compare-and-swap of PLACE
                                                                          The keyword arguments are passed unmodified to the expander, except that
                                                                          defaulting of ORDER is applied.
                                                                        • EXTERNAL FUNCTION
                                                                            • MUTEX
                                                                            • &OPTIONAL
                                                                            • WAITP
                                                                            Try to obtain exclusion on the given mutexIf WAITP is true, this function will not return until exclusion is obtained.\n\nReturn true iff exclusion was obtained, otherwise false.
                                                                          • EXTERNAL FUNCTION
                                                                              • MUTEX
                                                                              Release exclusion on the given mutex. Return no values.
                                                                            • EXTERNAL FUNCTION
                                                                                • PROCESS
                                                                                • FUNC
                                                                                Interrupt the given process to make it call the given function with no arguments. Return no values.
                                                                              • EXTERNAL FUNCTION
                                                                                  • M
                                                                                  No documentation provided.
                                                                                • EXTERNAL FUNCTION
                                                                                    • M
                                                                                    Return the owner of the lock - this may be NIL if it's not locked.
                                                                                  • EXTERNAL FUNCTION
                                                                                      • &KEY
                                                                                      • NAME
                                                                                      Make a new condition variableThe NAME argument is stored with the condition variable for debugging purposes.
                                                                                    • EXTERNAL FUNCTION
                                                                                        • &KEY
                                                                                        • NAME
                                                                                        Create and return a fresh mutex with the given name.
                                                                                      • EXTERNAL FUNCTION
                                                                                          • NAME
                                                                                          • FUNCTION
                                                                                          • &OPTIONAL
                                                                                          • ARGUMENTS
                                                                                          • SPECIAL_BINDINGS
                                                                                          • STACK-SIZE
                                                                                          Make and return a new process object. The new process is inactive; it can be started with PROCESS-START.
                                                                                          

                                                                                          NAME is the name of the process for display purposes. FUNCTION is the function that the process should execute. ARGUMENTS is a list of arguments that will be passed to the function when the process is enabled; the default is NIL. SPECIAL-BINDINGS is an alist of (symbol . form): the forms will be evaluated in a null lexical environment, and their values bound to the symbols (as if by PROGV) when the process is started.

                                                                                        • EXTERNAL FUNCTION
                                                                                            • &OPTIONAL
                                                                                            • NAME
                                                                                            Create and return a recursive mutex with the given name.
                                                                                          • EXTERNAL FUNCTION
                                                                                              • &OPTIONAL
                                                                                              • NAME
                                                                                              • WRITE-LOCK-NAME
                                                                                              Create and return a fresh shared mutex with the given name.
                                                                                            • EXTERNAL FUNCTION
                                                                                                • M
                                                                                                Return the name of the mutex, as provided at creation. The mutex may be normal or recursive.
                                                                                              • EXTERNAL FUNCTION
                                                                                                  • P
                                                                                                  Return true iff the process is active, i.e. is currently executed. More specifically, this means it has been started and is not currently suspended.
                                                                                                • EXTERNAL FUNCTION
                                                                                                    • P
                                                                                                    No documentation provided.
                                                                                                  • EXTERNAL FUNCTION
                                                                                                      • PROCESS
                                                                                                      Wait for the given process to finish executing. If the process's function returns normally, those values are returned. If the process exited due to EXIT-PROCESS, the values provided to that function are returned. If the process was aborted by ABORT-PROCESS or a control transfer, an error of type PROCESS-JOIN-ERROR is signaled.
                                                                                                    • EXTERNAL FUNCTION
                                                                                                        • PROCESS
                                                                                                        Force a process to end. This function is not intended for regular usage and is not reliable.
                                                                                                      • EXTERNAL FUNCTION
                                                                                                          • P
                                                                                                          Return the name of a process, as provided at its creation.
                                                                                                        • EXTERNAL FUNCTION
                                                                                                            • PROCESS
                                                                                                            Current Phase of the process. Nascent = 0, Active = 1, Suspended = 2, Exited = 3
                                                                                                          • EXTERNAL FUNCTION
                                                                                                              • PROCESS
                                                                                                              Current Phase of the process as String (Not yet started, Running, Suspended, Aborted, Completed)
                                                                                                            • EXTERNAL FUNCTION
                                                                                                                • PROCESS
                                                                                                                Restart execution in a suspended process.
                                                                                                              • EXTERNAL FUNCTION
                                                                                                                  • NAME
                                                                                                                  • FUNCTION
                                                                                                                  • &OPTIONAL
                                                                                                                  • SPECIAL_BINDINGS
                                                                                                                  Convenience function that creates a process and then immediately starts it. Arguments are as in MAKE-PROCESS; the ARGUMENTS parameter is always NIL.
                                                                                                                • EXTERNAL FUNCTION
                                                                                                                    • PROCESS
                                                                                                                    Start execution of a nascent process. Return no values.
                                                                                                                  • EXTERNAL FUNCTION
                                                                                                                      • PROCESS
                                                                                                                      Stop a process from executing temporarily. Execution may be restarted with PROCESS-RESUME.
                                                                                                                    • EXTERNAL FUNCTION
                                                                                                                          Inform the scheduler that the current process doesn't need control for the moment. It may or may not use this information. Returns no values.
                                                                                                                        • EXTERNAL FUNCTION
                                                                                                                            • SYMBOL
                                                                                                                            • FORM
                                                                                                                            No documentation provided.
                                                                                                                          • EXTERNAL FUNCTION
                                                                                                                              • M
                                                                                                                              No documentation provided.
                                                                                                                            • EXTERNAL FUNCTION
                                                                                                                                • MUTEX
                                                                                                                                Obtain the shared lock for this mutex.
                                                                                                                              • EXTERNAL FUNCTION
                                                                                                                                  • MUTEX
                                                                                                                                  Release the shared lock for this mutex.
                                                                                                                                • EXTERNAL FUNCTION
                                                                                                                                      No documentation provided.
                                                                                                                                    • EXTERNAL FUNCTION
                                                                                                                                        • &OPTIONAL
                                                                                                                                        • PROCESS
                                                                                                                                        No documentation provided.
                                                                                                                                      • EXTERNAL FUNCTION
                                                                                                                                          • MUTEX
                                                                                                                                          • &OPTIONAL
                                                                                                                                          • UPGRADE
                                                                                                                                          Obtain the write lock for this mutex. upgradep should be true if and only if this thread currently holds the shared lock for the same mutex.
                                                                                                                                        • EXTERNAL FUNCTION
                                                                                                                                            • MUTEX
                                                                                                                                            • &OPTIONAL
                                                                                                                                            • UPGRADE
                                                                                                                                            Try to obtain the write lock for this mutex. If it cannot be obtained immediately, return false. Otherwise, return true.
                                                                                                                                          • EXTERNAL FUNCTION
                                                                                                                                              • MUTEX
                                                                                                                                              • &OPTIONAL
                                                                                                                                              • RELEASE_READ_LOCK
                                                                                                                                              Release the write lock. If releasep is true and the current thread holds the shared lock, it is released as well.
                                                                                                                                            • EXTERNAL GENERIC-FUNCTION
                                                                                                                                                • OBJECT
                                                                                                                                                Source
                                                                                                                                                No documentation provided.
                                                                                                                                              • EXTERNAL GENERIC-FUNCTION
                                                                                                                                                  • OBJECT
                                                                                                                                                  Source
                                                                                                                                                  No documentation provided.
                                                                                                                                                • EXTERNAL GENERIC-FUNCTION
                                                                                                                                                    • OBJECT
                                                                                                                                                    Source
                                                                                                                                                    No documentation provided.
                                                                                                                                                  • EXTERNAL MACRO
                                                                                                                                                        (ATOMIC place &key order &allow-other-keys)
                                                                                                                                                        Atomically read from PLACE. ORDER is an atomic ordering specifier, i.e. one of
                                                                                                                                                        the keywords:
                                                                                                                                                        :RELAXED :ACQUIRE :RELEASE :ACQUIRE-RELEASE :SEQUENTIALLY-CONSISTENT
                                                                                                                                                        The default is the last. The meanings of these match the C++ standard (more
                                                                                                                                                        detailed explanation forthcoming elsewhere).
                                                                                                                                                        Other keywords are passed to the atomic expander function.
                                                                                                                                                        Experimental.
                                                                                                                                                      • EXTERNAL MACRO
                                                                                                                                                            No documentation provided.
                                                                                                                                                          • EXTERNAL MACRO
                                                                                                                                                                No documentation provided.
                                                                                                                                                              • EXTERNAL MACRO
                                                                                                                                                                    No documentation provided.
                                                                                                                                                                  • EXTERNAL MACRO
                                                                                                                                                                        No documentation provided.
                                                                                                                                                                      • EXTERNAL MACRO
                                                                                                                                                                            As CL:POP, but as an atomic RMW operation.
                                                                                                                                                                          • EXTERNAL MACRO
                                                                                                                                                                                As CL:PUSH, but as an atomic RMW operation.
                                                                                                                                                                              • EXTERNAL MACRO
                                                                                                                                                                                    As CL:PUSHNEW, but as an atomic RMW operation.
                                                                                                                                                                                    ITEM, the subforms of PLACE, and the keywords are evaluated exactly once in the
                                                                                                                                                                                    same order as they are for CL:PUSHNEW, specified in CLHS 5.1.1.1.
                                                                                                                                                                                  • EXTERNAL MACRO
                                                                                                                                                                                        No documentation provided.
                                                                                                                                                                                      • EXTERNAL MACRO
                                                                                                                                                                                            Perform an atomic update of PLACE. In more detail, the value of PLACE is
                                                                                                                                                                                            set to (funcall UPDATE-FN VALUE ARGUMENTS...), where VALUE is the old value of
                                                                                                                                                                                            PLACE. This is analogous to what DEFINE-MODIFY-MACRO expansions do.
                                                                                                                                                                                            As with DEFINE-MODIFY-MACRO, the new value is returned.
                                                                                                                                                                                            Evaluation order is left to right as specified in CLHS 5.1.1.1. Note that this
                                                                                                                                                                                            is different from the SBCL macro of the same name, which may perform multiple
                                                                                                                                                                                            evaluations of the update-fn and arguments, and passes arguments to the update
                                                                                                                                                                                            function in a different order.
                                                                                                                                                                                          • EXTERNAL MACRO
                                                                                                                                                                                                No documentation provided.
                                                                                                                                                                                              • EXTERNAL MACRO

                                                                                                                                                                                                CAS

                                                                                                                                                                                                    (CAS place old new)
                                                                                                                                                                                                    Atomically store NEW in PLACE if OLD matches the current value of PLACE.
                                                                                                                                                                                                    Matching is as if by EQ.
                                                                                                                                                                                                    Returns the previous value of PLACE; if it's EQ to OLD the swap happened.
                                                                                                                                                                                                    Only the swap is atomic. Evaluation of PLACE's subforms, OLD, and NEW is
                                                                                                                                                                                                    not guaranteed to be in any sense atomic with the swap, and likely won't be.
                                                                                                                                                                                                    PLACE must be a CAS-able place. CAS-able places are either symbol macros,
                                                                                                                                                                                                    special variables,
                                                                                                                                                                                                    or accessor forms with a CAR of
                                                                                                                                                                                                    SYMBOL-VALUE, SYMBOL-PLIST, CLOS:STANDARD-INSTANCE-ACCESS, THE,
                                                                                                                                                                                                    SLOT-VALUE, CLOS:SLOT-VALUE-USING-CLASS, CAR, CDR, FIRST, REST, SVREF,
                                                                                                                                                                                                    or macro forms that expand into CAS-able places,
                                                                                                                                                                                                    or an accessor defined with DEFINE-ATOMIC-EXPANDER.
                                                                                                                                                                                                    Some CAS accessors have additional semantic constraints.
                                                                                                                                                                                                    You can see their documentation with e.g. (documentation 'slot-value 'mp:atomic)
                                                                                                                                                                                                    This is planned to be expanded to include variables,
                                                                                                                                                                                                    possibly other simple vectors, and slot accessors.
                                                                                                                                                                                                    Keys are passed to GET-ATOMIC-EXPANSION.
                                                                                                                                                                                                    Experimental.
                                                                                                                                                                                                  • EXTERNAL MACRO
                                                                                                                                                                                                        Analogous to DEFINE-SETF-EXPANDER; defines how to access (accessor ...)
                                                                                                                                                                                                        places atomically.
                                                                                                                                                                                                        The body must return the seven values of GET-ATOMIC-EXPANSION.
                                                                                                                                                                                                        It is up to you the definer to ensure the swap is performed atomically.
                                                                                                                                                                                                        This means you will almost certainly need Clasp's synchronization operators
                                                                                                                                                                                                        (e.g., CAS on some other place).
                                                                                                                                                                                                        Unlike setf expanders, atomic expanders can take arbitrary keyword arguments.
                                                                                                                                                                                                        These correspond to any keyword arguments used in an ATOMIC place, plus the
                                                                                                                                                                                                        keyword :environment which holds the environment, and the defaulting of :order
                                                                                                                                                                                                        to :sequentially-consistent. The EXPANDER-LAMBDA-LIST is this lambda list.
                                                                                                                                                                                                        All expanders should be prepared to accept :order and :environment. Anything
                                                                                                                                                                                                        beyond that is your extension.
                                                                                                                                                                                                      • EXTERNAL MACRO
                                                                                                                                                                                                            Establish a fence that prevents the compiler or CPU from reordering some
                                                                                                                                                                                                            accesses across it. Returns no values.
                                                                                                                                                                                                            ORDER is the same as accepted by ATOMIC, except that :relaxed does not make
                                                                                                                                                                                                            sense for fences and will be rejected.
                                                                                                                                                                                                          • EXTERNAL MACRO
                                                                                                                                                                                                                Executes BODY with deferrable interrupts conditionally enabled. If there
                                                                                                                                                                                                                are pending interrupts they take effect prior to executing BODY.
                                                                                                                                                                                                                

                                                                                                                                                                                                                As interrupts are normally allowed WITH-INTERRUPTS only makes sense if there is an outer WITHOUT-INTERRUPTS with a corresponding ALLOW-WITH-INTERRUPTS: interrupts are not enabled if any outer WITHOUT-INTERRUPTS is not accompanied by ALLOW-WITH-INTERRUPTS.

                                                                                                                                                                                                              • EXTERNAL MACRO
                                                                                                                                                                                                                    No documentation provided.
                                                                                                                                                                                                                  • EXTERNAL MACRO
                                                                                                                                                                                                                        Acquire rwlock for the dynamic scope of BODY for operation OP,
                                                                                                                                                                                                                        which is executed with the lock held by current thread, and
                                                                                                                                                                                                                        WITH-RWLOCK returns the values of body.
                                                                                                                                                                                                                        

                                                                                                                                                                                                                        Valid values of argument OP are :READ or :WRITE (for reader and writer access accordingly).

                                                                                                                                                                                                                      • EXTERNAL MACRO
                                                                                                                                                                                                                            Executes BODY with all deferrable interrupts disabled. Deferrable
                                                                                                                                                                                                                            interrupts arriving during execution of the BODY take effect after BODY has
                                                                                                                                                                                                                            been executed.
                                                                                                                                                                                                                            

                                                                                                                                                                                                                            Deferrable interrupts include most blockable POSIX signals, and MP:INTERRUPT-THREAD. Does not interfere with garbage collection, and unlike in many traditional Lisps using userspace threads, in ECL WITHOUT-INTERRUPTS does not inhibit scheduling of other threads.

                                                                                                                                                                                                                            Binds ALLOW-WITH-INTERRUPTS, WITH-LOCAL-INTERRUPTS and WITH-RESTORED-INTERRUPTS as a local macros.

                                                                                                                                                                                                                            WITH-RESTORED-INTERRUPTS executes the body with interrupts enabled if and only if the WITHOUT-INTERRUPTS was in an environment in which interrupts were allowed.

                                                                                                                                                                                                                            ALLOW-WITH-INTERRUPTS allows the WITH-INTERRUPTS to take effect during the dynamic scope of its body, unless there is an outer WITHOUT-INTERRUPTS without a corresponding ALLOW-WITH-INTERRUPTS.

                                                                                                                                                                                                                            WITH-LOCAL-INTERRUPTS executes its body with interrupts enabled provided that for there is an ALLOW-WITH-INTERRUPTS for every WITHOUT-INTERRUPTS surrounding the current one. WITH-LOCAL-INTERRUPTS is equivalent to:

                                                                                                                                                                                                                            (allow-with-interrupts (with-interrupts ...))

                                                                                                                                                                                                                            Care must be taken not to let either ALLOW-WITH-INTERRUPTS or WITH-LOCAL-INTERRUPTS appear in a function that escapes from inside the WITHOUT-INTERRUPTS in:

                                                                                                                                                                                                                            (without-interrupts ;; The body of the lambda would be executed with WITH-INTERRUPTS allowed ;; regardless of the interrupt policy in effect when it is called. (lambda () (allow-with-interrupts ...)))

                                                                                                                                                                                                                            (without-interrupts ;; The body of the lambda would be executed with interrupts enabled ;; regardless of the interrupt policy in effect when it is called. (lambda () (with-local-interrupts ...)))

                                                                                                                                                                                                                        Clone this wiki locally