原文出处: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. hdu 1536 S-Nim

    题意:首先输入K 表示一个集合的大小  之后输入集合 表示对于这对石子只能去除这个集合中的元素的 个数 之后输入一个m表示接下来对于这个集合要进行m次询问 之后m行 每行输入一个n 表示有  n个堆  ...

  2. C++运算符重载——重载二元运算符

    1.重载二元操作符的方法 二元运算符又称为双目运算符,即需要2个操作数的运算符,例如 + - * / 等. 运算符重载可以分为3种方式:类的非静态成员函数.类的友元函数.普通函数. 例如有 2 个操作 ...

  3. 如何用虚拟机装SQL Server

    更新(2016.3.14) 看来之前还是写的太简了,来问的同学有点多. 所以还是详细一些吧. 大概步骤 装好Virtual Box这个软件,免费的 下载window server 2003系统镜像,然 ...

  4. list、set、map的特点

    java 集合(list.set.map)的特点 集合相关的类有一大堆,一般也只用到常用的方法增删改查,而且它它们的方法名也基本一样,所以一直都不知道什么时候用什么集合, 今天趁有空特意从网上整理资料 ...

  5. swift:创建表格UITableView

    用swift创建单元格和用iOS创建单元格形式基本相同,就是语法上有些异样.swift中调用成员方法不再使用[ ]来发送消息,而是使用.成员方法的形式调用成员函数.这种格式非常类似于java中的点成员 ...

  6. gdb与adb相关命令总结

    在使用gdb与adb时需要注意一些类似于权限的问题,比如设备需要root,设备root后命令行下需要 切换用户到root用户下操作,又比如相关的目录或文件是否有足够的权限等等,总结为如下: (以下示例 ...

  7. ubuntu 12.04安装vncserver

    1.安装桌面 apt-get install ubuntu-desktop 2.安装vncserver apt-get install vnc4server 3.设置vncserver密码 vncpa ...

  8. 纯HTML标签详解

    HTML标签很多,可是实际上常用的却就那么十几二十个,很多标签的功能渐渐的被大家忽略了.然后,如果在适当的时候,用一用,还是能在一定程序上 给我们的页面设计带来一点小小的方便的.下面这些HTML标签基 ...

  9. 结构体快排qsort()

    曾经用到过一次快排,感觉代码量没有减小,反而比较函数有点难编,但是这种排序一般不会出错(前提是比较函数写对了),而且速度很快,熟练后其实还是非常好用的! 用到快排是因为我做到一个题,是uva的1042 ...

  10. 38-语言入门-38-Coin Test

    题目地址: http://acm.nyist.net/JudgeOnline/problem.php?pid=204    描述As is known to all,if you throw a co ...