- 博客(1)
- 资源 (9)
- 收藏
- 关注
转载 使用pthread_cond_timedwait()超时时间设置问题
最近在使用pthread_cond_timedwait的时候,发现当超时时间设置成1秒以下的值时,无法得到想要的效果,具体表现为,没有wait足够的时间就被唤醒,且返回值正确。首先来看一下pthread_cond_timedwait的原型:#include int pthread_cond_timedwait(pthread_cond_t *restrict cond,pthrea
2014-06-17 14:05:34 17541
Using the POSIX API - Threads, real-time and 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
2013-03-24
New features in Linux-2.6
虽然Linux早已到了3.8时代,但是2.6内核非常经典,在嵌入式行业依然被广泛应用。这部slides专为嵌入式开发人员而写。
2013-03-24
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人