Jun 13

semaphore and mutex 不指定

felix021 @ 2009-6-13 01:08 [IT » 程序设计] 评论(1) , 引用(0) , 阅读(5955) | Via 本站原创 | |
花了一点时间测试使用semaphore和pthread_mutex这两个东西,很赞。

#include<semaphore.h>
sem_init()
sem_wait()
sem_post()

#include<pthread.h>
pthread_mutex_init()
pthread_mutex_lock()
pthread_mutex_unlock()

@ 2009-06-14 0:00 p.s.
居然还有 pthread_spinlock_t .... Orz了。
pthread_spin_init()
pthread_spin_lock()
pthread_spin_unlock()



欢迎扫码关注:




转载请注明出自 ,如是转载文则注明原出处,谢谢:)
RSS订阅地址: https://www.felix021.com/blog/feed.php
slyar Email Homepage
2009-6-13 19:27
线程锁?高级玩意...只听说过...YM
felix021 回复于 2009-6-13 21:06
这东西不高级阿。。多线程编程的时候经常会用到的
分页: 1/1 第一页 1 最后页
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   *非必须
网址   电邮   [注册]