SMP Design: Difference between revisions

From AlsaProject
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
The SMP / multithread design has several levels in the ALSA project codebase. The kernel drivers are fully SMP / thread safe. The alsa-lib was designed to allow grouping of commands for returned handle to optimize pthread locking. The snd_*_open() calls are thread safe. The use of returned handles must be serialized in the application using own locking scheme. Standalone (not handle related) functions in alsa-lib should be fully thread safe.
The SMP / multithread design has several levels in the ALSA project codebase. The kernel drivers are fully SMP / thread safe. The alsa-lib was designed to allow grouping of commands for returned handle to optimize pthread locking. The snd_*_open() calls are thread safe. The use of returned handles must be serialized in the application using own locking scheme. Standalone (not handle related) functions in alsa-lib should be fully thread safe.
There are a few global variables that are used in alsa-lib, such as the global error handler pointer and the global root config pointer.
Accessing / modifying these would be thread-unsafe.


If you find a bug in kernel or alsa-lib which breaks these rules, please, let us know.
If you find a bug in kernel or alsa-lib which breaks these rules, please, let us know.

Latest revision as of 11:14, 31 January 2013

The SMP / multithread design has several levels in the ALSA project codebase. The kernel drivers are fully SMP / thread safe. The alsa-lib was designed to allow grouping of commands for returned handle to optimize pthread locking. The snd_*_open() calls are thread safe. The use of returned handles must be serialized in the application using own locking scheme. Standalone (not handle related) functions in alsa-lib should be fully thread safe.

There are a few global variables that are used in alsa-lib, such as the global error handler pointer and the global root config pointer. Accessing / modifying these would be thread-unsafe.

If you find a bug in kernel or alsa-lib which breaks these rules, please, let us know.