[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


E.1.1 cma Handles

A cma handle is storage, similar to a pointer, that refers to a specific DECthreads object (thread, mutex, condition variable, queue, or attributes object).

Handles are allocated by the user application. They can be freely copied by the program and stored in any class of storage; objects are managed by DECthreads.

Because DECthreads objects are only accessed by handles in the cma interface, you can think of the handle as if it were the object itself.

DECthreads objects are accessed by handles in the cma interface, rather than pointers, because handles allow for greater robustness and portability. Handles allow DECthreads to detect the following types of run-time errors:

Handles do not exist in the POSIX 1003.1c standard interface. While providing less robustness due to more limited error checking, this allows better performance by decreasing memory use and memory access (handles result in pointers to pointers).