PMDF Programmer's Reference Manual
PMDF-PRM-6.0


Previous | Contents

1.5 Usage from multi-threaded processes

With the exception of the PMDF_database_ routines, the PMDF API and underlying routines are re-entrant and thread-safe. Multithreaded routines which will be using the PMDF API must call PMDF_set_mutex before calling any other API routines, including PMDF_initialize. The PMDF_set_mutex routine provides PMDF with routines to call to create, lock, unlock, and dispose of thread mutexes. See the description of PMDF_set_mutex for further details.

For each PMDF database, a single per-process read context is maintained by PMDF. As such, any sequence of chained PMDF_database_get_entry calls must not be interrupted by other threads accessing the same database with PMDF_database_ calls. Any interruption will disrupt the read state. A chained sequence is one that starts with a PMDF_DATABASE_GET_FIRST or PMDF_DATABASE_GET_FIRST_ROOT access followed by PMDF_DATABASE_GET_NEXT or PMDF_DATABASE_GET_NEXT_ROOT access to find subsequent, related entries.

Note that access to the PMDF queue cache database is thread safe.


Previous | Next | Contents