43.0 Synchronization Concepts

Synchronization deals with ensuring that data or resource accesses do not occur at the same instant from two or more threads. You must determine whether it is necessary to synchronize access to data. Some memory locations are read-only from the beginning and do not need synchronization. Other locations must be preserved against more than one thread writing to them at the same time. There are also data variables that are changed infrequently.

LibC supports a comprehensive set of synchronization primitives, which were based on an evaluation of the synchronization needs for services that might be ported to LibC and includes interfaces for the following synchronization mechanisms:

NKS spin locks and barriers are not currently implemented. For NetWare® operating system spin locks, see netware.h.

LibC supports the following synchronization interfaces:

The synchronization interface you select should match the thread interface you select. Novell does not recommend mixing interfaces. For example, you should use NKS synchronization functions with NKS threads rather than pthreads.

This section covers the following topics: