原文出处:http://blog.csdn.net/zhengdy/article/details/5485472

                                             Windows 和 Linux 的IPC API对应表

Table 1. Process mapping
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
Table 2. Thread mapping
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
pthread_setschedpolicy
pthread_attr_setschedparam
pthread_attr_setschedpolicy>

Context Specific

Table 3. Synchronization mapping
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
Table 4. Semaphore mapping
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
Table 5. Event objects mapping
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
Table 6. Mutex mapping
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
Table 7. Critical section mapping
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
Table 6. Mutex mapping
Windows Linux -- threads Linux -- process Classification
SignalObjectAndWait semop semop Context specific
WaitForMultipleObjects sem_wait
sem_trywait
semop Context specific

Windows 和 Linux 的IPC API对应表的更多相关文章

  1. MySQL在windows和linux下的表名大小写问题

    MySQL在windows下是不区分大小写的,将script文件导入MySQL后表名也会自动转化为小写,结果再想要将数据库导出放到linux服务 器中使用时就出错了.因为在linux下表名区分大小写而 ...

  2. 4.windows和Linux下创建oracleusername表空间,表,插入数据,用户管理表等操作

    进入超级管理员,运行下面命令 Window下创建数据库.表空间,用户,插入数据等操作 -- 01 创建表空间 -- 注意表空间的路径 依据实际安装环境进行调整 CREATE TABLESPACE ts ...

  3. Windows、Linux下文件操作(写、删除)错误的产生原因、及解决方法

    catalog . 引言 . Linux平台上涉及的File IO操作 . Windows平台上涉及的File IO操作 0. 引言 本文试图讨论在windows.linux操作系统上基于C库进行文件 ...

  4. 【转】进程间通信方式总结(windows 和linux)

    平时看的书很多,了解的也很多,但不喜欢总结,这不昨天面试的时候被问到了进程间通信的方式,因为没有认真总结过,所以昨天答得不是特别好.现在将linux和windows的进程间通信方式好好总结一下.    ...

  5. [转帖]Windows和Linux对决(多进程多线程)

    Windows和Linux对决(多进程多线程) https://blog.csdn.net/world_2015/article/details/44920467 太长了 还没看完.. 还是没太理解好 ...

  6. 【Linux技术】Windows与Linux系统下的库·初探

    库的定义  库文件是一些预先编译好的函数的集合,那些函数都是按照可再使用的原则编写的.它们通常由一组互相关联的用来完成某项常见工作的函数构成,从本质上来说库是一种可执行代码的二进制形式,可以被操作系统 ...

  7. Windows与Linux下进程间通信技术比较

    一般我们写的程序都是以单个进程的方式来运行的,比较少涉及到多进程.特别是在windows下,因为Windows是按照线程来分配CPU时间片的,线程是最小的调度单位,所以在Windows下更多的用到多线 ...

  8. linux各种IPC机制(进程通信)

    linux各种IPC机制 (2011-07-08 16:58:35)      原文地址:linux各种IPC机制(转)作者:jianpengliu 原帖发表在IBM的developerworks网站 ...

  9. [转帖]linux各种IPC机制

    linux各种IPC机制 docker中的资源隔离,一种就是IPC的隔离.IPC是进程间通信. 下面的文章转载自https://blog.csdn.net/yyq_9623/article/detai ...

随机推荐

  1. CentOS系统安装JDK

    使用yum安装 1.查看yum库是否有java安装包 yum -y list java* 2.安装jdk yum -y install  java-1.8* 3.安装完成后,执行java -versi ...

  2. 点击UITableView的cell展开收缩

    在项目中有个需求,点击表视图的单元格展开,再点击另外一个单元格或者本身又收缩,经过一段时间尝试,实现了该功能,现在记录分享总结下.   首先要理解UITableView代理方法调用的先后顺序.   当 ...

  3. qt之透明提示框(模拟qq) (非常漂亮)

    Qt实现类似QQ的登录失败的提示框,主要涉及窗口透明并添加关闭按钮,以及图标和信息的显示等. 直接上代码: #include "error_widget.h" ErrorWidge ...

  4. Qt中的多线程技术(列表总结比较,多线程创建和销毁其实是有开销的,只是增加了用户体验而已)

    http://blog.csdn.net/u011012932/article/details/52943811

  5. Java应用发布后,需要关注的7个性能指标

    在某个重大发布之后,都需要记录相应的指标,本文介绍了最重要的几个 Java 性能指标,包括响应时间和平均负载等.为理解应用程序在生产环境中如何运行,就需要遵循一些 Java 性能指标. 在以前,当软件 ...

  6. Java:集合for高级循环遍历

    增强for循环: 格式:for(变量数据类型 要遍历的变量 :元素所在数组(集合)名称) 也即 for(Type element: array或collection) 使用foreach遍历集合: 只 ...

  7. DataGridView过滤区分大小写问题

    DataTable上的过滤方法: 一.可以用DataTable.Select("条件"),返回DataRow[]格式的结果集. DataRow[] drArr = dt.Selec ...

  8. apache-hadoop-1.2.1、hbase、hive、mahout、nutch、solr安装教程

    1 软件环境: VMware8.0 Ubuntu-12.10-desktop-i386 jdk-7u40-linux-i586.tar.gz hadoop-1.2.1.tar.gz eclipse-d ...

  9. json 字符串转换成对象,对象转换成json字符串

    json   字符串转换成对象,对象转换成json字符串 前端: 方法一: parseJSON方法:   [注意jquery版本问题] var str = '{"name":&qu ...

  10. 验证工具类 - ValidateUtils.java

    验证工具类,提供验证email格式.是否ipv4.是否ipv6.是否中文.是否数字.正则表达式验证的方法. 源码如下:(点击下载 - ValidateUtils.java .commons-lang- ...