Pthreads
From HP-SEE Wiki
Contents |
- Web site: http://www.unix.org/version3/ieee_std.html
- Described version: xx.xx
- Licensing: GNU Lesser General Public License
- User documentation: link
- Download: link
- Source code: link
Authors/Maintainers
- Also origin, if the software comes from a specific project.
Summary
Threads, like processes, are a mechanism to allow a program to do more than one thing at a time. As with processes, threads appear to run concurrently; the Linux kernel schedules them asynchronously, interrupting each thread from time to time to give others a chance to execute. GNU/Linux implements the POSIX standard thread API (known as PThreads). Implementations of the API are available on many Unix-like POSIX systems such as FreeBSD, NetBSD, GNU/Linux, Mac OS X and Solaris. Microsoft Windows has a pthreads implementation and supports a subset of the Pthread API for the Windows 32-bit platform. The Pthread interfaces described in this section are based on a subset of the application programming interfaces (APIs) defined in the POSIX standard (ANSI/IEEE Standard 1003.1, 1996 Edition OR ISO/IEC 9945-1: 1996) and the Single UNIX Specification, Version 2, 1997. The implementation of these APIs is not compliant with these standards. However, the implementation does attempt to duplicate the portable nature of the interfaces defined by the standards. Pthreads are defined as a set of C language programming types and procedure calls, implemented with a pthread.h header/include file and a thread library - though this library may be part of another library, such aslibc, in some implementations. All thread functions and data types are declared in the header file <pthread.h>. The subroutines which comprise the Pthreads API can be informally grouped into four major groups:
• Thread management: Routines that work directly on threads - creating, detaching, joining, etc. They also include functions to set/query thread attributes (joinable, scheduling etc.)
• Mutexes: Routines that deal with synchronization, called a "mutex", which is an abbreviation for "mutual exclusion". Mutex functions provide for creating, destroying, locking and unlocking mutexes. These are supplemented by mutex attribute functions that set or modify attributes associated with mutexes.
• Condition variables: Routines that address communications between threads that share a mutex. Based upon programmer specified conditions. This group includes functions to create, destroy, wait and signal based upon specified variable values. Functions to set/query condition variable attributes are also included.
• Synchronization: Routines that manage read/write locks and barriers.
Pthreads tutorials are available at:
• https://computing.llnl.gov/tutorials/pthreads/
• http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html
Features
- Listed features
Architectural/Functional Overview
- high level design info, how it works, performance - may be a link, or several links
Usage Overview
- If possible with small example - may be a link
Dependacies
- list of all relevant dependencies on other libraries
HP-SEE Applications
- DNAMA(based on RAxML)
Resource Centers
- RCs supporting it (with version number if not the same as above)
Usage by Other Projects and Communities
- If any
Recommendations for Configuration and Usage
Please describe here any common settings, configurations or conventions that would make the usage of this resource (library or tool) more interoperable or scalable across the HP-SEE resources. These recommendations should include anything that is related to the resource and is agreed upon by administrators and users, or across sites and applications. These recommendations should emerge from questions or discussions opened by site administrators or application developers, at any stage, including installation, development, usage, or adaptation for another HPC centre.
Provided descriptions should describe general or site specific aspects of resource installation, configuration and usage, or describe the guidelines or convention for deploying or using the resource within the local (user/site) or temporary environment (job). Examples are:
- Common configuration settings of execution environment
- Filesystem path or local access string
- Environment variables to be set or used by applications
- Options (e.g. additional modules) that are needed or required by applications and should be present
- Minimum quantitative values (e.g. quotas) offered by the site
- Location and format of some configuration or usage hint instructing applications on proper use of the resource or site specific policy
- Key installation or configuration settings that should be set to a common value, or locally tweaked by local site admins
- Conventions for application or job bound installation and usage of the resource