社区
Linux/Unix社区
帖子详情
pthread_cancel和pthread_exit有什么区别啊
huanghuanghuang
2005-03-09 09:03:53
rt
...全文
1567
4
打赏
收藏
pthread_cancel和pthread_exit有什么区别啊
rt
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
4 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
tengulre
2005-03-10
打赏
举报
回复
up
core
2005-03-10
打赏
举报
回复
2
cancel结束另外一个进程
exit结束自己
blankman
2005-03-10
打赏
举报
回复
#include <pthread.h>
int pthread_cancel(pthread_t thread);
pthread_cancel sends a cancellation request to the thread denoted by the thread argument.
------------------------------------------------
#include <pthread.h>
void pthread_exit(void *retval);
pthread_exit terminates the execution of the calling thread.
understand?
huanghuanghuang
2005-03-10
打赏
举报
回复
up
P
thread
-Primer.rar_p
thread
_unix primer
5. `p
thread
_can
cel
()`:取消指定线程的执行。 6. `p
thread
_once()`:确保某个初始化操作只执行一次。 三、线程创建与销毁 通过`p
thread
_create()`函数可以创建新的线程,需要提供线程函数的指针和传递给该函数的...
QNX环境下多线程编程
QNX环境下多线程编程可以提高系统的性能和效率,QNX提供了符合POSIX标准的多线程API,例如p
thread
_create()、p
thread
_join()、p
thread
_can
cel
()等,可以用于线程的创建、终止、取消和同步等操作。
线程基本编程——线程函数大全.doc
p
thread
_can
cel
函数用于请求终止一个线程。该函数需要一个参数:要终止的线程的
Thread
ID。 例如: ```c p
thread
_t tid; int ret = p
thread
_can
cel
(tid); if (ret != 0) { perror("p
thread
_can
cel
");
exit
(1); ...
p
thread
库文档
`p
thread
_spin_init()`和`p
thread
_spin_destroy()`初始化和销毁自旋锁,`p
thread
_spin_lock()`和`p
thread
_spin_unlock()`用于锁定和解锁。 四、调度策略与优先级 `p
thread
`库允许设置线程的调度策略和优先级。`...
P
thread
多线程编程指南
5. **线程取消**:`p
thread
_can
cel
()`函数可以请求取消一个线程,而`p
thread
_setcan
cel
state()`和`p
thread
_setcan
cel
type()`则用于设置线程的取消状态和类型。 6. **线程调度**:P
thread
支持抢占式调度和非抢占式...
Linux/Unix社区
23,209
社区成员
74,537
社区内容
发帖
与我相关
我的任务
Linux/Unix社区
Linux/Unix社区 应用程序开发区
复制链接
扫一扫
分享
社区描述
Linux/Unix社区 应用程序开发区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章