首页 > 代码库 > Windows 和 Linux 的IPC API对应表
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 pthread_setschedpolicy pthread_attr_setschedparam pthread_attr_setschedpolicy> | 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对应表
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。