易截截图软件、单文件、免安装、纯绿色、仅160KB

Windows 和 Linux 的IPC API对应表

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


相关文档:

Linux下的C编程入门之“线程”控制与“线程”通信编程

本文来自:Linux教程 -- http://doc.linuxpk.com/53295.html
如有不明白之处,欢迎参加社区讨论
1.Linux“线程”
 笔者曾经在《基于嵌入式操作系统VxWorks的多任务并发程序设计》(《软件报》2006年第5~12期)中详细叙述了进程和线程的区别,并曾经说明Linux是一种“多进程单线程”的操作系统。 ......

linux 批量替换多个文件中的某个字符串

在linux的日常服务器维护站点维护中,经常需要批量操作一部分文件,比如数据库用户的资料变更,那么所以相关站点的数据库配置文件要相应的修改。大家都知道,linux下面几乎所有的配置文件都是纯粹的文本文件,所以这其实就是一个基本的文本操作。一台服务器上有上百个甚至上千个的网站。如果我们一个个来修改不是不可以,但 ......

Linux 网卡配置文件及相关设置


1.配置文件
/etc/hosts(本地主机ip地址映射,可以有多个别名)。
/etc/services(端口号与标准服务之间的对应关系)。
/etc/sysconfig/network(设置主机名,网关,域名)。
HOSTANME=zjw.com(主机名)(需要重启计算机才有效)
GATEWAY=192.168.1.1(网关)
/etc/rc.d/init.d/network restart(脚本服务启动)
servi ......

关于linux下看视频和无声的问题

学linux有几天了   今天突然想在linux下看看视频   突然发现  adobe没有装   于是就去网上下载了一堆adobe 发现都没有用  问题还是没有解决   于是在论坛上求教  效果也不是很大  不是说的太专业  就是对我的情况不了解  没有办法  只好自己摸 ......

Linux下配置Java环境变量


本文介绍如何在Linux下配置Java环境变量。配置共分十个步骤,从下载JDK开始,到Linux上JDK的安装,Eclipse的相应配置,最终在桌面上创建一个启动器,路径设置到Eclipse,就此完成Java环境变量的配置。
1.去http://java.sun.com/j2se/1.4.2/download.html
下载一个Linux Platform的JDK,
建议下载RPM自解压格式的(RP ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号