Multiprocessing.h
上传用户:xjjlds
上传日期:2015-12-05
资源大小:22823k
文件大小:36k
- /*
- File: Multiprocessing.h
-
- Contains: Multiprocessing interfaces
-
- Version: Technology: Multiprocessing API version 2.0, integrated nanokernel support
- Release: QuickTime 6.0.2
-
- Copyright: (c) 1995-2001 DayStar Digital, Inc.
-
- Bugs?: For bug reports, consult the following page on
- the World Wide Web:
-
- http://developer.apple.com/bugreporter/
-
- */
- /*
- ===========================================================================================
- *** WARNING: You must properly check the availability of MP services before calling them!
- See the section titled "Checking API Availability".
- ===========================================================================================
- */
- #ifndef __MULTIPROCESSING__
- #define __MULTIPROCESSING__
- #ifndef __MACTYPES__
- #include "MacTypes.h"
- #endif
- #ifndef __CODEFRAGMENTS__
- #include "CodeFragments.h"
- #endif
- #ifndef __DRIVERSERVICES__
- #include "DriverServices.h"
- #endif
- #if PRAGMA_ONCE
- #pragma once
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- #if PRAGMA_IMPORT
- #pragma import on
- #endif
- #if PRAGMA_STRUCT_ALIGN
- #pragma options align=power
- #elif PRAGMA_STRUCT_PACKPUSH
- #pragma pack(push, 2)
- #elif PRAGMA_STRUCT_PACK
- #pragma pack(2)
- #endif
- /*
- ===========================================================================================
- This is the header file for version 2.0 of the Mac OS multiprocessing support. This version
- has been totally reimplemented and has significant new services. The main goal of the
- reimplementation has been to transfer task management into the core operating system to provide
- much more reliable and more efficient operation, including on single processor machines.
- The memory management has also been massively improved, it is much faster and wastes much
- less space. New services include POSIX style per-task storage, timers with millisecond and
- microsecond resolutions, memory allocation at a specified alignment, and system pageable
- and RAM resident memory pools. See the MP API documentation for details.
- The old "DayStar" debugging services (whose names began with an underscore) have been
- removed from this header. A very few are still implemented for binary compatibility, or in
- cases where they happened to be exposed inappropriately. (E.g. _MPIsFullyInitialized must
- be called to see if the MP API is ReallyTruly(tm) usable.) New code and recompiles of old
- code should avoid use of these defunct services, except for _MPIsFullyInitialized.
- ===========================================================================================
- */
- /*
- ===========================================================================================
- The following services are from the original MP API and remain supported in version 2.0:
- MPProcessors
- MPCreateTask
- MPTerminateTask
- MPCurrentTaskID
- MPYield
- MPExit
- MPCreateQueue
- MPDeleteQueue
- MPNotifyQueue
- MPWaitOnQueue
- MPCreateSemaphore
- MPCreateBinarySemaphore (In C only, a macro that calls MPCreateSemaphore.)
- MPDeleteSemaphore
- MPSignalSemaphore
- MPWaitOnSemaphore
- MPCreateCriticalRegion
- MPDeleteCriticalRegion
- MPEnterCriticalRegion
- MPExitCriticalRegion
- MPAllocate (Deprecated, use MPAllocateAligned for new builds.)
- MPFree
- MPBlockCopy
- MPLibraryIsLoaded (In C only, a macro.)
- _MPIsFullyInitialized (See comments about checking for MP API availability.)
- ===========================================================================================
- */
- /*
- ===========================================================================================
- The following services are new in version 2.0:
- MPProcessorsScheduled
- MPSetTaskWeight
- MPTaskIsPreemptive
- MPAllocateTaskStorageIndex
- MPDeallocateTaskStorageIndex
- MPSetTaskStorageValue
- MPGetTaskStorageValue
- MPSetQueueReserve
- MPCreateEvent
- MPDeleteEvent
- MPSetEvent
- MPWaitForEvent
- UpTime
- DurationToAbsolute
- AbsoluteToDuration
- MPDelayUntil
- MPCreateTimer
- MPDeleteTimer
- MPSetTimerNotify
- MPArmTimer
- MPCancelTimer
- MPSetExceptionHandler
- MPThrowException
- MPDisposeTaskException
- MPExtractTaskState
- MPSetTaskState
- MPRegisterDebugger
- MPUnregisterDebugger
- MPAllocateAligned (Preferred over MPAllocate.)
- MPGetAllocatedBlockSize
- MPBlockClear
- MPDataToCode
- MPRemoteCall (Preferred over _MPRPC.)
- ===========================================================================================
- */
- /*
- ===========================================================================================
- The following services are new in version 2.1:
- MPCreateNotification
- MPDeleteNotification
- MPModifyNotification
- MPCauseNotification
- MPGetNextTaskID
- MPGetNextCpuID
- ===========================================================================================
- */
- /*
- ===========================================================================================
- The following services are "unofficial" extensions to the original API. They are not in
- the multiprocessing API documentation, but were in previous versions of this header. They
- remain supported in version 2.0. They may not be supported in other environments.
- _MPRPC (Deprecated, use MPRemoteCall for new builds.)
- _MPAllocateSys (Deprecated, use MPAllocateAligned for new builds.)
- _MPTaskIsToolboxSafe
- _MPLibraryVersion
- _MPLibraryIsCompatible
- ===========================================================================================
- */
- /*
- ===========================================================================================
- The following services were in previous versions of this header for "debugging only" use.
- They are NOT implemented in version 2.0. For old builds they can be accessed by defining
- the symbol MPIncludeDefunctServices to have a nonzero value.
- _MPInitializePrintf
- _MPPrintf
- _MPDebugStr
- _MPStatusPString
- _MPStatusCString
- ===========================================================================================
- */
- /*
- .
- ===========================================================================================
- General Types and Constants
- ===========================
- */
- #define MPCopyrightNotice
- "Copyright