Introduction
POSIX thread is short for pthread, and POSIX thread isPOSIXStandard thread. This standard defines the internal API creation and thread manipulation.
Function
The thread library implements the POSIX thread standard, usually
Today Test yourself write multithreaded program, according to the actual situation, should create more than 3,000 lines Cheng Yes, but, when created to 378, the error came, Pthread_create () failed, just started to think this is an exception, so,
multithreaded Programmingthe thread private data Pthreadis a short name for POSIX threads. It's POSIX.Threading Standards. thread synchronization from mutual exclusion amount of "C + + multithreaded programming Six" pthread Mutual rejection
1. Pthread Thread Concept
The multithreading under Linux system follows the POSIX thread interface, called Pthread. Write a multithreaded program under Linux, you need to use the header file Pthread.h, the connection needs to use the library
In the case of multi-threaded implementation, pthread_t is used as the abstract type and is specified as the whole line with a length of 4 as the thread ID.
In the thread implementation of some iseries servers, the thread ID is a 64-bit integer
Pthread is a set of user-level thread libraries, but the kernel-level threads are used for implementation on Linux to improve thread concurrency. pthread is a set of common thread libraries provided by POSIX and has good portability.
Used to
Pthread is a set of user-level thread libraries, but kernel-level threads are used for implementation on Linux. The advantage is that the concurrency of programs can be fully improved, the thread can also call functions such as head as before,
multithreaded Programmingterminates the pthread thread Pthreadis the POSIX threads abbreviation, is POSIX'sThreading Standards. terminating a thread seems to be the last step in multithreaded programming, but it is by no means the end of this
In Linux, the concept and processing of threads and processes are not strictly differentiated like other operating systems. in Linux, a thread is also called a lightweight process. in addition, the important difference between windows and Windows
This is an old article written in 2013, put on Gegahost.net http://raison.gegahost.net/?p=91March 7, 2013life of a NPTL pthreadfiled UNDER:CONCURRENCY,LINUX,POSIX-TAGS:NPTL, Pthread-raison @ 12:52 pm(Original work by Peixu Zhu)NPTL Pthread is the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.