Multiprocessing Services Reference
| Framework | CoreServices/CoreServices.h |
| Companion guide | Multiprocessing Services Programming Guide |
| Declared in | Multiprocessing.h MultiprocessingInfo.h |
Overview
Multiprocessing Services is an API that lets you create preemptive tasks in your application that can run on one or more microprocessors. Unlike the cooperative threads created by the Thread Manager, Multiprocessing Services automatically divides processor time among the available tasks, so that no particular task can monopolize the system. This document is relevant to you if you want to add multitasking capability to your Mac OS applications.
In OS X, Carbon supports Multiprocessing Services with the following restrictions:
Debugging functions are not implemented. Use the mach APIs provided by the system to implement debugging services.
Opaque notification IDs are local to your process; they are not globally addressable across processes.
Global memory allocation is not supported.
Functions by Task
Determining Multiprocessing Services And Processor Availability
-
_MPIsFullyInitialized -
MPGetNextCpuIDDeprecated in OS X v10.7 -
MPProcessorsDeprecated in OS X v10.7 -
MPProcessorsScheduledDeprecated in OS X v10.7
Creating and Handling Message Queues
-
MPCreateQueueDeprecated in OS X v10.7 -
MPDeleteQueueDeprecated in OS X v10.7 -
MPNotifyQueueDeprecated in OS X v10.7 -
MPSetQueueReserveDeprecated in OS X v10.7 -
MPWaitOnQueueDeprecated in OS X v10.7
Creating and Handling Semaphores
-
MPCreateSemaphoreDeprecated in OS X v10.7 -
MPDeleteSemaphoreDeprecated in OS X v10.7 -
MPSignalSemaphoreDeprecated in OS X v10.7 -
MPWaitOnSemaphoreDeprecated in OS X v10.7
Creating and Scheduling Tasks
-
MPCreateTaskDeprecated in OS X v10.7 -
MPCurrentTaskIDDeprecated in OS X v10.7 -
MPExitDeprecated in OS X v10.7 -
MPGetNextTaskIDDeprecated in OS X v10.7 -
MPSetTaskWeightDeprecated in OS X v10.7 -
MPTaskIsPreemptiveDeprecated in OS X v10.7 -
MPTerminateTaskDeprecated in OS X v10.7 -
MPYieldDeprecated in OS X v10.7 -
MPSetTaskTypeDeprecated in OS X v10.8
Handling Critical Regions
-
MPCreateCriticalRegionDeprecated in OS X v10.7 -
MPDeleteCriticalRegionDeprecated in OS X v10.7 -
MPEnterCriticalRegionDeprecated in OS X v10.7 -
MPExitCriticalRegionDeprecated in OS X v10.7
Handling Event Groups
-
MPCreateEventDeprecated in OS X v10.7 -
MPDeleteEventDeprecated in OS X v10.7 -
MPSetEventDeprecated in OS X v10.7 -
MPWaitForEventDeprecated in OS X v10.7
Handling Kernel Notifications
-
MPCauseNotificationDeprecated in OS X v10.7 -
MPCreateNotificationDeprecated in OS X v10.7 -
MPDeleteNotificationDeprecated in OS X v10.7 -
MPModifyNotificationDeprecated in OS X v10.7 -
MPModifyNotificationParametersDeprecated in OS X v10.7
Accessing Per-Task Storage Variables
-
MPAllocateTaskStorageIndexDeprecated in OS X v10.7 -
MPDeallocateTaskStorageIndexDeprecated in OS X v10.7 -
MPGetTaskStorageValueDeprecated in OS X v10.7 -
MPSetTaskStorageValueDeprecated in OS X v10.7
Memory Allocation Functions
-
MPAllocateDeprecated in OS X v10.7 -
MPAllocateAlignedDeprecated in OS X v10.7 -
MPBlockClearDeprecated in OS X v10.7 -
MPBlockCopyDeprecated in OS X v10.7 -
MPDataToCodeDeprecated in OS X v10.7 -
MPFreeDeprecated in OS X v10.7 -
MPGetAllocatedBlockSizeDeprecated in OS X v10.7
Remote Calling Functions
-
MPRemoteCallDeprecated in OS X v10.7 -
MPRemoteCallCFMDeprecated in OS X v10.7
Timer Services Functions
-
MPArmTimerDeprecated in OS X v10.7 -
MPCancelTimerDeprecated in OS X v10.7 -
MPCreateTimerDeprecated in OS X v10.7 -
MPDelayUntilDeprecated in OS X v10.7 -
MPDeleteTimerDeprecated in OS X v10.7 -
MPSetTimerNotifyDeprecated in OS X v10.7
Exception Handling Functions
-
MPDisposeTaskExceptionDeprecated in OS X v10.7 -
MPExtractTaskStateDeprecated in OS X v10.7 -
MPSetExceptionHandlerDeprecated in OS X v10.7 -
MPSetTaskStateDeprecated in OS X v10.7 -
MPThrowExceptionDeprecated in OS X v10.7
Debugger Support Functions
-
MPRegisterDebuggerDeprecated in OS X v10.7 -
MPUnregisterDebuggerDeprecated in OS X v10.7
Functions
_MPIsFullyInitialized
Indicates whether Multiprocessing Services is available for use.
Boolean _MPIsFullyInitialized ( void );
Return Value
If true, Multiprocessing Services is available for use; otherwise, false.
Declared In
Multiprocessing.hCallbacks
MPRemoteProcedure
Defines a remote procedure call.
typedef void* (*MPRemoteProcedure) ( void *parameter );
For example, this is how you would declare the application-defined function if you were to name the function MyRemoteProcedure:
void* MyRemoteProcedure ( void *parameter );
Parameters
- parameter
A pointer to the application-defined value you passed to the function
MPRemoteCallCFM. For example, this value could point to a data structure or a memory location.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hTaskProc
Defines the entry point of a task.
typedef OSStatus (*TaskProc) ( void *parameter );
For example, this is how you would declare the application-defined function if you were to name the function MyTaskProc:
OSStatus MyTaskProc ( void *parameter );
Parameters
- parameter
A pointer to the application-defined value you passed to the function
MPCreateTask. For example, this value could point to a data structure or a memory location.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hData Types
MPAddressSpaceID
typedef struct OpaqueMPAddressSpaceID * MPAddressSpaceID;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPAddressSpaceInfo
struct MPAddressSpaceInfo {
PBVersion version;
MPProcessID processID;
MPCoherenceID groupID;
ItemCount nTasks;
UInt32 vsid[16];
};
typedef struct MPAddressSpaceInfo MPAddressSpaceInfo;
Availability
- Available in OS X v10.1 and later.
Declared In
MultiprocessingInfo.hMPAreaID
typedef struct OpaqueMPAreaID * MPAreaID;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPCoherenceID
Represents a memory coherence group.
typedef struct OpaqueMPCoherenceID * MPCoherenceID;
Discussion
A coherence group is the set of processors and other bus controllers that have cache-coherent access to memory. Mac OS 9 defines only one coherence group, which is all the processors that can access internal memory (RAM). Other coherence groups are possible; for example, a PCI card with its own memory and processors can comprise a coherence group.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPConsoleID
typedef struct OpaqueMPConsoleID * MPConsoleID;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPCpuID
Represents a CPU ID.
typedef struct OpaqueMPCpuID * MPCpuID;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPCriticalRegionID
Represents a critical region ID, which Multiprocessing Services uses to manipulate critical regions.
typedef struct OpaqueMPCriticalRegionID * MPCriticalRegionID;
Discussion
You obtain a critical region ID by calling the function MPCreateCriticalRegion.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPCriticalRegionInfo
struct MPCriticalRegionInfo {
PBVersion version;
MPProcessID processID;
OSType regionName;
ItemCount nWaiting;
MPTaskID waitingTaskID;
MPTaskID owningTask;
ItemCount count;
};
typedef struct MPCriticalRegionInfo MPCriticalRegionInfo;
Availability
- Available in OS X v10.0 and later.
Declared In
MultiprocessingInfo.hMPEventFlags
Represents event information for an event group.
typedef UInt32 MPEventFlags;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPEventID
Represents an event group ID, which Multiprocessing Services uses to manipulate event groups.
typedef struct OpaqueMPEventID * MPEventID;
Discussion
You obtain an event group ID by calling the function MPCreateEvent.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPEventInfo
struct MPEventInfo {
PBVersion version;
MPProcessID processID;
OSType eventName;
ItemCount nWaiting;
MPTaskID waitingTaskID;
MPEventFlags events;
};
typedef struct MPEventInfo MPEventInfo;
Availability
- Available in OS X v10.0 and later.
Declared In
MultiprocessingInfo.hMPExceptionKind
Represents the kind of exception thrown.
typedef UInt32 MPExceptionKind;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPNotificationID
Represents a notification ID, which Multiprocessing Services uses to manipulate kernel notifications.
typedef struct OpaqueMPNotificationID * MPNotificationID;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPNotificationInfo
struct MPNotificationInfo {
PBVersion version;
MPProcessID processID;
OSType notificationName;
MPQueueID queueID;
void * p1;
void * p2;
void * p3;
MPEventID eventID;
MPEventFlags events;
MPSemaphoreID semaphoreID;
};
typedef struct MPNotificationInfo MPNotificationInfo;
Availability
- Available in OS X v10.0 and later.
Declared In
MultiprocessingInfo.hMPOpaqueID
Represents a generic notification ID (that is, an ID that could be a queue ID, event ID, kernel notification ID, or semaphore ID).
typedef struct OpaqueMPOpaqueID * MPOpaqueID;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPOpaqueIDClass
typedef UInt32 MPOpaqueIDClass;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPPageSizeClass
typedef UInt32 MPPageSizeClass;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPProcessID
Represents a process ID.
typedef struct OpaqueMPProcessID * MPProcessID;
Discussion
Note that this process ID is identical to the process ID (or context ID) handled by the Code Fragment Manager.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPQueueID
Represents a queue ID, which Multiprocessing Services uses to manipulate message queues.
typedef struct OpaqueMPQueueID * MPQueueID;
Discussion
You obtain a queue ID by calling the function MPCreateQueue.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPQueueInfo
struct MPQueueInfo {
PBVersion version;
MPProcessID processID;
OSType queueName;
ItemCount nWaiting;
MPTaskID waitingTaskID;
ItemCount nMessages;
ItemCount nReserved;
void * p1;
void * p2;
void * p3;
};
typedef struct MPQueueInfo MPQueueInfo;
Availability
- Available in OS X v10.0 and later.
Declared In
MultiprocessingInfo.hMPSemaphoreCount
Represents a semaphore count.
typedef ItemCount MPSemaphoreCount;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPSemaphoreID
Represents a semaphore ID, which Multiprocessing Services uses to manipulate semaphores.
typedef struct OpaqueMPSemaphoreID * MPSemaphoreID;
Discussion
You obtain a semaphore ID by calling the function MPCreateSemaphore.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPSemaphoreInfo
struct MPSemaphoreInfo {
PBVersion version;
MPProcessID processID;
OSType semaphoreName;
ItemCount nWaiting;
MPTaskID waitingTaskID;
ItemCount maximum;
ItemCount count;
};
typedef struct MPSemaphoreInfo MPSemaphoreInfo;
Availability
- Available in OS X v10.0 and later.
Declared In
MultiprocessingInfo.hMPTaskID
Represents a task ID.
typedef struct OpaqueMPTaskID * MPTaskID;
Discussion
You obtain a task ID by calling the function MPCreateTask.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPTaskInfo
Contains information about a task.
struct MPTaskInfo {
PBVersion version;
OSType name;
OSType queueName;
UInt16 runState;
UInt16 lastCPU;
UInt32 weight;
MPProcessID processID;
AbsoluteTime cpuTime;
AbsoluteTime schedTime;
AbsoluteTime creationTime;
ItemCount codePageFaults;
ItemCount dataPageFaults;
ItemCount preemptions;
MPCpuID cpuID;
MPOpaqueID blockedObject;
MPAddressSpaceID spaceID;
LogicalAddress stackBase;
LogicalAddress stackLimit;
LogicalAddress stackCurr;
};
typedef struct MPTaskInfo MPTaskInfo;
Fields
versionThe version of this data structure.
nameThe name of the task.
queueNameA four-byte code indicating the status of the queue waiting on the task.
runStateThe current state of the task (running, ready, or blocked).
lastCPUThe address of the last processor that ran this task.
weightThe weighting assigned to this task.
processIDThe ID of the process that owns this task.
cpuTimeThe accumulated CPU time used by the task.
schedTimeThe time when the task was last scheduled.
creationTimeThe time when the task was created.
codePageFaultsThe number of page faults that occurred during code execution.
dataPageFaultsThe number of page faults that occurred during data access.
preemptionsThe number of times this task was preempted.
cpuIDThe ID of the last processor that ran this task.
blockedObjectReserved for use by OS X.
spaceIDAddress space ID of this task.
stackBaseThe lowest memory address of the task’s stack.
stackLimitThe highest memory address of the task’s stack.
stackCurrThe current stack address.
Discussion
If you specify the kMPTaskStateTaskInfo constant when calling the function MPExtractTaskState , Multiprocessing Services returns state information in an MPTaskInfo structure.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPTaskInfoVersion2
struct MPTaskInfoVersion2 {
PBVersion version;
OSType name;
OSType queueName;
UInt16 runState;
UInt16 lastCPU;
UInt32 weight;
MPProcessID processID;
AbsoluteTime cpuTime;
AbsoluteTime schedTime;
AbsoluteTime creationTime;
ItemCount codePageFaults;
ItemCount dataPageFaults;
ItemCount preemptions;
MPCpuID cpuID;
};
typedef struct MPTaskInfoVersion2 MPTaskInfoVersion2;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPTaskStateKind
typedef UInt32 MPTaskStateKind;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPTaskWeight
Represents the relative processor weighting of a task.
typedef UInt32 MPTaskWeight;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hMPTimerID
Represents a timer ID.
typedef struct OpaqueMPTimerID * MPTimerID;
Discussion
You obtain a timer ID by calling the function MPCreateTimer.
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hTaskStorageIndex
Represents a task storage index value used by functions described in “Accessing Per-Task Storage Variables.”
typedef ItemCount TaskStorageIndex;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hTaskStorageValue
Represents a task storage value used by functions described in “Accessing Per-Task Storage Variables.”
typedef LogicalAddress TaskStorageValue;
Availability
- Available in OS X v10.0 and later.
Declared In
Multiprocessing.hConstants
Allocation constants
The maximum memory allocation size.
enum {
kMPMaxAllocSize = 1024L * 1024 * 1024
};
Constants
kMPMaxAllocSizeThe maximum allocation size: 1GB.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Task IDs
Use to specify no task ID.
enum {
kMPNoID = kInvalidID
};
Constants
kMPNoIDNo task ID.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Discussion
Used when calling MPTaskIsPreemptive if you want to specify the current task.
Data Structure Version Constants
Data structure version information constants.
enum {
kMPQueueInfoVersion = 1L | (kOpaqueQueueID << 16),
kMPSemaphoreInfoVersion = 1L | (kOpaqueSemaphoreID << 16),
kMPEventInfoVersion = 1L | (kOpaqueEventID << 16),
kMPCriticalRegionInfoVersion = 1L | (kOpaqueCriticalRegionID << 16),
kMPNotificationInfoVersion = 1L | (kOpaqueNotificationID << 16),
kMPAddressSpaceInfoVersion = 1L | (kOpaqueAddressSpaceID << 16)
};
Constants
kMPQueueInfoVersionThe
MPQueueInfostructure version.Available in OS X v10.0 and later.
Declared in
MultiprocessingInfo.h.kMPSemaphoreInfoVersionThe
MPSemaphoreInfostructure version.Available in OS X v10.0 and later.
Declared in
MultiprocessingInfo.h.kMPEventInfoVersionThe
MPEventInfostructure version.Available in OS X v10.0 and later.
Declared in
MultiprocessingInfo.h.kMPCriticalRegionInfoVersionThe
MPCriticalRegionInfostructure version.Available in OS X v10.0 and later.
Declared in
MultiprocessingInfo.h.kMPNotificationInfoVersionThe
MPNotificationInfostructure version.Available in OS X v10.0 and later.
Declared in
MultiprocessingInfo.h.kMPAddressSpaceInfoVersionThe
MPAddressSpaceInfostructure version.Available in OS X v10.1 and later.
Declared in
MultiprocessingInfo.h.
Values for the MPOpaqueIDClass type
Constants indicating the source of a generic notification.
enum {
kOpaqueAnyID = 0,
kOpaqueProcessID = 1,
kOpaqueTaskID = 2,
kOpaqueTimerID = 3,
kOpaqueQueueID = 4,
kOpaqueSemaphoreID = 5,
kOpaqueCriticalRegionID = 6,
kOpaqueCpuID = 7,
kOpaqueAddressSpaceID = 8,
kOpaqueEventID = 9,
kOpaqueCoherenceID = 10,
kOpaqueAreaID = 11,
kOpaqueNotificationID = 12,
kOpaqueConsoleID = 13
};
Constants
kOpaqueAnyIDAny source.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueProcessIDA process.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueTaskIDA task.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueTimerIDA timer.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueQueueIDA queue.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueSemaphoreIDA semaphore.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueCriticalRegionIDA critical region.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueCpuIDA CPU.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueAddressSpaceIDAn address space.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueEventIDAn event.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueCoherenceIDA coherence group.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueAreaIDAn area.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueNotificationIDA notification.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kOpaqueConsoleIDA console.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Memory Allocation Alignment Constants
Specify the alignment of the desired memory block when calling the MPAllocateAligned function.
enum {
kMPAllocateDefaultAligned = 0,
kMPAllocate8ByteAligned = 3,
kMPAllocate16ByteAligned = 4,
kMPAllocate32ByteAligned = 5,
kMPAllocate1024ByteAligned = 10,
kMPAllocate4096ByteAligned = 12,
kMPAllocateMaxAlignment = 16,
kMPAllocateAltiVecAligned = kMPAllocate16ByteAligned,
kMPAllocateVMXAligned = kMPAllocateAltiVecAligned,
kMPAllocateVMPageAligned = 254,
kMPAllocateInterlockAligned = 255
};
Constants
kMPAllocateDefaultAlignedUse the default alignment.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocate8ByteAlignedUse 8-byte alignment.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocate16ByteAlignedUse 16-byte alignment.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocate32ByteAlignedUse 32-byte alignment.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocate1024ByteAlignedUse 1024-byte alignment.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocate4096ByteAlignedUse 4096-byte alignment.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocateMaxAlignmentUse the maximum alignment (65536 byte).
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocateAltiVecAlignedUse AltiVec alignment.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocateVMXAlignedUse VMX (now called AltiVec) alignment.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocateVMPageAlignedUse virtual memory page alignment. This alignment is set at runtime.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocateInterlockAlignedUse interlock alignment, which is the alignment needed to allow the use of CPU interlock instructions (that is,
lwarxandstwcx.) on the returned memory address. This alignment is set at runtime. In most cases you would never need to use this alignment.Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Memory Allocation Option Constants
Specify optional actions when calling the MPAllocateAligned function.
enum {
kMPAllocateClearMask = 0x0001,
kMPAllocateGloballyMask = 0x0002,
kMPAllocateResidentMask = 0x0004,
kMPAllocateNoGrowthMask = 0x0010,
kMPAllocateNoCreateMask = 0x0020
};
Constants
kMPAllocateClearMaskZero out the allocated memory block.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocateGloballyMaskAllocate memory from in memory space that is visible to all processes. Note that such globally-allocated space is not automatically reclaimed when the allocating process terminates. By default,
MPAllocateAlignedallocates memory from process-specific (that is, not global) memory.Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocateResidentMaskAllocate memory from resident memory only (that is, the allocated memory is not pageable).
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocateNoGrowthMaskDo not attempt to grow the pool of available memory. Specifying this option is useful, as attempting to grow memory may cause your task to block until such memory becomes available.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPAllocateNoCreateMaskDo not attempt to create the pool if it does not yet exist.
Available in OS X v10.1 and later.
Declared in
Multiprocessing.h.
MPDebuggerLevel
Indicates the debugger level.
typedef UInt32 MPDebuggerLevel;
enum {
kMPLowLevelDebugger = 0x00000000,
kMPMidLevelDebugger = 0x10000000,
kMPHighLevelDebugger = 0x20000000
};
Constants
kMPLowLevelDebuggerThe low-level debugger.
Available in OS X v10.1 and later.
Declared in
Multiprocessing.h.kMPMidLevelDebuggerThe mid-level debugger.
Available in OS X v10.1 and later.
Declared in
Multiprocessing.h.kMPHighLevelDebuggerThe high-level debugger.
Available in OS X v10.1 and later.
Declared in
Multiprocessing.h.
Library Version Constants
Identifies the current library version.
enum {
MPLibrary_MajorVersion = 2,
MPLibrary_MinorVersion = 3,
MPLibrary_Release = 1,
MPLibrary_DevelopmentRevision = 1
};
Constants
MPLibrary_MajorVersionMajor version number.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.MPLibrary_MinorVersionMinor version number.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.MPLibrary_ReleaseRelease number.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.MPLibrary_DevelopmentRevisionDevelopment revision number.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Remote Call Context Option Constants
Specify which contexts are allowed to execute the callback function when using MPRemoteCall.
enum {
kMPAnyRemoteContext = 0,
kMPOwningProcessRemoteContext = 1,
kMPInterruptRemoteContext = 2,
kMPAsyncInterruptRemoteContext = 3
};
typedef UInt8 MPRemoteContext;
Constants
kMPAnyRemoteContextAny cooperative context can execute the function. Note that the called function may not have access to any of the owning context’s process-specific low-memory values.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPOwningProcessRemoteContextOnly the context that owns the task can execute the function.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPInterruptRemoteContextUnsupported in OS X.
Available in OS X v10.1 and later.
Declared in
Multiprocessing.h.kMPAsyncInterruptRemoteContextUnsupported in OS X.
Available in OS X v10.1 and later.
Declared in
Multiprocessing.h.
Discussion
These constants are used to support older versions of Mac OS and are ignored in OS X.
Task Creation Options
Specify optional actions when calling the MPCreateTask function.
enum {
kMPCreateTaskSuspendedMask = 1L << 0,
kMPCreateTaskTakesAllExceptionsMask = 1L << 1,
kMPCreateTaskNotDebuggableMask = 1L << 2,
kMPCreateTaskValidOptionsMask = kMPCreateTaskSuspendedMask | kMPCreateTaskTakesAllExceptionsMask | kMPCreateTaskNotDebuggableMask
};
typedef OptionBits MPTaskOptions;
Constants
kMPCreateTaskSuspendedMaskUnsupported in OS X.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPCreateTaskTakesAllExceptionsMaskThe task will take all exceptions, including those normally handled by the system, such as page faults.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPCreateTaskNotDebuggableMaskUnsupported in OS X.
Available in OS X v10.1 and later.
Declared in
Multiprocessing.h.kMPCreateTaskValidOptionsMaskInclude all valid options for this task.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Task Exception Disposal Constants
Specify actions to take on an exception when passed in the action parameter of the MPDisposeTaskException function.
enum {
kMPTaskPropagate = 0,
kMPTaskResumeStep = 1,
kMPTaskResumeBranch = 2,
kMPTaskResumeMask = 0x0000,
kMPTaskPropagateMask = 1 << kMPTaskPropagate,
kMPTaskResumeStepMask = 1 << kMPTaskResumeStep,
kMPTaskResumeBranchMask = 1 << kMPTaskResumeBranch
};
Constants
kMPTaskPropagateThe exception is propagated.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskResumeStepThe task is resumed and single step is enabled.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskResumeBranchThe task is resumed and branch stepping is enabled.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskResumeMaskResume the task.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskPropagateMaskPropagate the exception to the next debugger level.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskResumeStepMaskResume the task and enable single stepping.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskResumeBranchMaskResume the task and enable branch stepping.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Task Information Structure Version Constant
Indicates the current version of the MPTaskInfo structure (returned as the first field).
enum {
kMPTaskInfoVersion = 3
};
Constants
kMPTaskInfoVersionThe current version of the task information structure.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Task Run State Constants
Indicate the state of the task when returned as part of the MPTaskInfo data structure.
enum {
kMPTaskBlocked = 0,
kMPTaskReady = 1,
kMPTaskRunning = 2
};
Constants
kMPTaskBlockedThe task is blocked..
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskReadyThe task is ready for execution.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskRunningThe task is currently running.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Task State Constants
Specify what states you want to set or obtain when calling the MPExtractTaskState or MPSetTaskState functions.
enum {
kMPTaskStateRegisters = 0,
kMPTaskStateFPU = 1,
kMPTaskStateVectors = 2,
kMPTaskStateMachine = 3,
kMPTaskState32BitMemoryException = 4,
kMPTaskStateTaskInfo = 5
};
Constants
kMPTaskStateRegistersThe task’s general-purpose (GP) registers. The
RegisterInformationPowerPCstructure inMachineExceptions.hdefines the format of this information.Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskStateFPUThe task’s floating point registers. The
FPUInformationPowerPCstructure inMachineExceptions.hdefines the format of this information.Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskStateVectorsThe task’s vector registers. The
VectorInformationPowerPCstructure inMachineExceptions.hdefines the format of this information.Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskStateMachineThe task’s machine registers. The
MachineInformationPowerPCstructure inMachineExceptions.hdefines the format of this information. Note that the MSR, ExceptKind, DSISR, and DAR registers are read-only.Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskState32BitMemoryExceptionThe task’s exception information for older 32-bit memory exceptions (that is, memory exceptions on 32-bit CPUs). The
MemoryExceptionInformationstructure inMachineExceptions.hdefines the format of this information. This exception information is read-only.Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTaskStateTaskInfoStatic and dynamic information about the task, as described by the data structure
MPTaskInfo. This task information is read-only.Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Timer Duration Constants
Specify the maximum time a task should wait for an event to occur.
enum {
kDurationImmediate = 0,
kDurationForever = 0x7FFFFFFF,
kDurationMillisecond = 1,
kDurationMicrosecond = -1
};
Constants
kDurationImmediateThe task times out immediately, whether or not the event has occurred. If the event occurred, the return status is
noErr. If the event did not occur, the return status iskMPTimeoutErr(assuming no other errors occurred).Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kDurationForeverThe task waits forever. The blocking call waits until either the event occurs, or until the object being waited upon (such as a message queue) is deleted.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kDurationMillisecondThe task waits one millisecond before timing out.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kDurationMicrosecondThe task waits one microsecond before timing out.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Discussion
You can use these constants in conjunction with other values to indicate specific wait intervals. For example, to wait 1 second, you can pass kDurationMillisecond * 1000.
Timer Option Masks
Indicate optional actions when calling MPArmTimer.
enum {
kMPPreserveTimerIDMask = 1L << 0,
kMPTimeIsDeltaMask = 1L << 1,
kMPTimeIsDurationMask = 1L << 2
};
Constants
kMPPreserveTimerIDMaskSpecifying this mask prevents the timer from being deleted when it expires.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTimeIsDeltaMaskSpecifying this mask indicates that the specified time should be added to the previous expiration time to form the new expiration time. You can use this mask to compensate for timing drift caused by the finite amount of time required to arm the timer, receive the notification, and so on.
Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.kMPTimeIsDurationMaskSpecifying this mask indicates that the specified expiration time is of type
Duration. You can use this mask to avoid having to call time conversion routines when specifying an expiration time.Available in OS X v10.0 and later.
Declared in
Multiprocessing.h.
Result Codes
Result codes defined for Multiprocessing Services are listed below.
Gestalt Constants
You can determine which system software calls are preemptively-safe for Multiprocessing Services by using the preemptive function attribute selectors defined in the Gestalt Manager. For more information, see Gestalt Manager Reference.
© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-07-23)