Windows 和 Linux 的IPC API对应表
原文出处:http://blog.csdn.net/zhengdy/article/details/5485472
Windows 和 Linux 的IPC API对应表
| Windows | Linux | Classification |
|---|---|---|
| CreateProcess() CreateProcessAsUser() |
fork() setuid() exec() |
Mappable |
| TerminateProcess() | kill() | Mappable |
| SetThreadpriority() GetThreadPriority() |
Setpriority() GetPriority() |
Mappable |
| GetCurrentProcessID() | getpid() | Mappable |
| Exitprocess() | exit() | Mappable |
| WaitForSingleObjec() WaitForMultipleObject() GetExitCodeProcess() |
waitpid() ※Using Sys V semaphores, WaitForSingleObjec/MultipleObject can be implemented |
Context specific |
| GetEnvironmentVariable() SetEnvironmentVariable() |
getenv() setenv() |
Mappable |
| Windows | Linux | Classification |
|---|---|---|
| CreateThread() | pthread_create pthread_attr_init pthread_attr_setstacksize pthread_attr_destroy |
Mappable |
| ThreadExit() | pthread_exit | Mappable |
| WaitForSingleObject() | pthread_join pthread_attr_setdetachstate pthread_detach |
Mappable |
| SetPriorityClass() SetThreadPriority() |
setpriority sched_setscheduler sched_setparam pthread_setschedparam |
Context Specific |
| Windows | Linux -- threads | Linux -- process |
|---|---|---|
| Mutex | Mutex - pthread library | System V semaphores |
| Critical section | Mutex - pthread library | Not applicable as critical sections are used only between the threads of the same process |
| Semaphore | Conditional Variable with mutex - pthreads POSIX semaphores |
System V Semaphores |
| Event | Conditional Variable with mutex - pthreads | System V Semaphores |
| Windows | Linux -- threads | Linux -- process | Classification |
|---|---|---|---|
| CreateSemaphore | sem_init | semget semctl |
Context specific |
| OpenSemaphore | Not applicable | semget | Context specific |
| WaitForSingleObject | sem_wait sem_trywait |
semop | Context specific |
| ReleaseSemaphore | sem_post | semop | Context specific |
| CloseHandle | sem_destroy | semctl | Context specific |
| Windows | Linux -- threads | Linux -- process | Classification |
|---|---|---|---|
| CreateEvent OpenEvent |
pthread_cond_init sem_init |
semget semctl |
Context specific |
| SetEvent | pthread_cond_signal sem_post |
semop | Context specific |
| ResetEvent | N/A | N/A | Context specific |
| WaitForSingleObject | pthread_cond_wait pthread_cond_timedwait sem_wait sem_trywait |
semop | Context specific |
| CloseHandle | pthread_cond_destroy sem_destroy |
semctl | Context specific |
| Windows | Linux -- threads | Linux -- process | Classification |
|---|---|---|---|
| CreateMutex | pthreads_mutex_init | semget semctl |
Context specific |
| OpenMutex | Not applicable | semget | Context specific |
| WaitForSingleObject | pthread_mutex_lock pthread_mutex_trylock |
semop | Context specific |
| ReleaseMutex | pthread_mutex_unlock | semop | Context specific |
| CloseHandle | pthread_mutex_destroy | semctl | Context specific |
| Windows | Linux | Classification |
|---|---|---|
| InitializeCriticalSection InitializeCriticalSectionAndSpinCount |
pthreads_mutex_init | Mappable |
| EnterCriticalSection TryEnterCriticalSection |
pthread_mutex_lock pthread_mutex_trylock |
Mappable |
| LeaveCriticalSection | pthread_mutex_unlock | Mappable |
| DeleteCriticalSection | pthread_mutex_destroy | Mappable |
| Windows | Linux -- threads | Linux -- process | Classification |
|---|---|---|---|
| SignalObjectAndWait | semop | semop | Context specific |
| WaitForMultipleObjects | sem_wait sem_trywait |
semop | Context specific |
Windows 和 Linux 的IPC API对应表的更多相关文章
- MySQL在windows和linux下的表名大小写问题
MySQL在windows下是不区分大小写的,将script文件导入MySQL后表名也会自动转化为小写,结果再想要将数据库导出放到linux服务 器中使用时就出错了.因为在linux下表名区分大小写而 ...
- 4.windows和Linux下创建oracleusername表空间,表,插入数据,用户管理表等操作
进入超级管理员,运行下面命令 Window下创建数据库.表空间,用户,插入数据等操作 -- 01 创建表空间 -- 注意表空间的路径 依据实际安装环境进行调整 CREATE TABLESPACE ts ...
- Windows、Linux下文件操作(写、删除)错误的产生原因、及解决方法
catalog . 引言 . Linux平台上涉及的File IO操作 . Windows平台上涉及的File IO操作 0. 引言 本文试图讨论在windows.linux操作系统上基于C库进行文件 ...
- 【转】进程间通信方式总结(windows 和linux)
平时看的书很多,了解的也很多,但不喜欢总结,这不昨天面试的时候被问到了进程间通信的方式,因为没有认真总结过,所以昨天答得不是特别好.现在将linux和windows的进程间通信方式好好总结一下. ...
- [转帖]Windows和Linux对决(多进程多线程)
Windows和Linux对决(多进程多线程) https://blog.csdn.net/world_2015/article/details/44920467 太长了 还没看完.. 还是没太理解好 ...
- 【Linux技术】Windows与Linux系统下的库·初探
库的定义 库文件是一些预先编译好的函数的集合,那些函数都是按照可再使用的原则编写的.它们通常由一组互相关联的用来完成某项常见工作的函数构成,从本质上来说库是一种可执行代码的二进制形式,可以被操作系统 ...
- Windows与Linux下进程间通信技术比较
一般我们写的程序都是以单个进程的方式来运行的,比较少涉及到多进程.特别是在windows下,因为Windows是按照线程来分配CPU时间片的,线程是最小的调度单位,所以在Windows下更多的用到多线 ...
- linux各种IPC机制(进程通信)
linux各种IPC机制 (2011-07-08 16:58:35) 原文地址:linux各种IPC机制(转)作者:jianpengliu 原帖发表在IBM的developerworks网站 ...
- [转帖]linux各种IPC机制
linux各种IPC机制 docker中的资源隔离,一种就是IPC的隔离.IPC是进程间通信. 下面的文章转载自https://blog.csdn.net/yyq_9623/article/detai ...
随机推荐
- lintcode:最大间隔
题目 给定一个未经排序的数组,请找出其排序表中连续两个要素的最大间距. 如果数组中的要素少于 2 个,请返回 0. 注意事项 可以假定数组中的所有要素都是非负整数,且最大不超过 32 位整数. 样例 ...
- Java-马士兵设计模式学习笔记-观察者模式-OOD线程
一.概述 1.情景:孩子睡觉,醒后要吃东西,用java模拟此情况 2.设计:child类,Dad类,都继承Runnable,dad线程监视child线程(缺点:因为要监视,所以耗cup资源) 二.代码 ...
- Qt之界面出现、消失动画效果(简单好用)
在学习Qt的这2.3个月里,对Qt越发感兴趣,从刚开始的盲目.无所适从到现在的学习.研究.熟练.掌握的过程中,我学到了很多东西,也学会了如何通过自学让自己更加成熟.强大起来,如何更有效地提高自己学习. ...
- #-webkit-autofill##google#启用表单自动填充时,如何覆盖黄色背景
google和opera浏览器的表单自动填充后,输入框均会变成黄色背景,黑色字体.如下图. 这样的话会与网页的整体设计风格不一致,怎样自定义样式,来覆盖黄色背景. 首先来看看是什么导致的,右键查看元素 ...
- 文件格式PDF
pdf(Portable Document Format的简称,意为“便携式文档格式”),是由Adobe Systems用于与应用程序.操作系统.硬件无关的方式进行文件交换所发展出的文件格式.PDF文 ...
- 卷积神经网络和CIFAR-10:Yann LeCun专访 Convolutional Nets and CIFAR-10: An Interview with Yann LeCun
Recently Kaggle hosted a competition on the CIFAR-10 dataset. The CIFAR-10 dataset consists of 60k 3 ...
- 深入理解Java内存模型(六)——final
与前面介绍的锁和volatile相比较,对final域的读和写更像是普通的变量访问.对于final域,编译器和处理器要遵守两个重排序规则: 在构造函数内对一个final域的写入,与随后把这个被构造对象 ...
- 验证工具类 - ValidateUtils.java
验证工具类,提供验证email格式.是否ipv4.是否ipv6.是否中文.是否数字.正则表达式验证的方法. 源码如下:(点击下载 - ValidateUtils.java .commons-lang- ...
- 字符串 —— String?StringBuffer?StringBuilder?
字符串常用的操作就是拼接,特别是SQL语句的拼接. 做了个简单的试验,它们之间的差别惊人! StringBuffer: public void testStringBuffer() { long st ...
- 用Eclipse+ADT创建可运行项目,创建lib项目,引用一个lib项目
Managing Projects from Eclipse with ADT In this document Creating an Android Project 创建可运行项目 Settin ...