Next: Task Creation
Up: Shared Memory Architecture
Previous: Shared Memory System Coherence
Contents
Shared Memory Programming
- Shared memory parallel programming is perhaps the easiest model to understand because of its similarity with operating systems programming and general multiprogramming.
- Shared memory programming is done through some extensions to existing
programming languages, operating systems, and code libraries.
- Shared address space programming paradigms can vary on mechanisms for data sharing, concurrency models, and support for synchronization.
- Process based models assume that all data associated with a process is private, by default, unless otherwise specified (using UNIX system calls such as shmget and shmat).
- While this is important for ensuring protection in multiuser systems, it is not necessary when multiple concurrent aggregates are cooperating to solve the same problem.
- The overheads associated with enforcing protection domains make processes less suitable for parallel programming.
- In contrast, lightweight processes and threads assume that all memory is global. By relaxing the protection domain, lightweight processes and threads support much faster manipulation.
- Directive based programming models extend the threaded model by facilitating creation and synchronization of threads.
- In a shared memory parallel program, there must exist three main programming constructs:
- task creation,
- communication,
- synchronization.
Subsections
Next: Task Creation
Up: Shared Memory Architecture
Previous: Shared Memory System Coherence
Contents
Cem Ozdogan
2006-12-27