文件名称:Using the POSIX API - Threads, real-time and IPC
文件大小:957KB
文件格式:PDF
更新时间:2016-04-13 03:59:59
POSIX-API Threads real-time IPC
In Linux, when a new process is created, it already contains a thread, used to execute the main() function Additional threads can be created using the pthread library, which is part of the C library Of course all threads inside a given process will share the same address space, the same set of open files, etc. The pthread library also provide thread synchronization primitives: mutexes and conditions This pthread library has its own header : pthread.h Applications using pthread function calls should be explicitly linked with the pthread library gcc o app app.c lpthread