易截截图软件、单文件、免安装、纯绿色、仅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是一种“多进程单线程”的操作系统。 ......

构建ARM Linux交叉编译工具链

2.2  构建ARM Linux交叉编译工具链
构建交叉编译器的第一个步骤就是确定目标平台。在GNU系统中,每个目标平台都有一个明确的格式,这些信息用于在构建过程中识别要使用的不同工具的正确版本。因此,当在一个特定目标机下运行GCC时,GCC便在目录路径中查找包含该目标规范的应用程序路径。GNU的目标规范格式为CPU-PLATF ......

怎样创建真正很小的Linux下的ELF可执行文件


怎样创建真正很小的Linux下的ELF可执行文件
转载: ELF文件格式研究
日期: Friday, July 25 @ 14:46:16 CST
主题: 软件开发

发信人: someone (++), 信区: Linux

标 题: 怎样创建真正很小的Linux下的ELF可执行文件
发信站: ......

Linux RPM

在Linux操作系统中,有一个系统软件包,它的功能类似于Windows里面的“添加/删除程序”,但是功能又比“添加/删除程序”强很多,它就是Red Hat Package Manager(简称RPM)。此工具包最先是由Red Hat公司推出的,后来被其他Linux开发商所借用。由于它为Linux使用者省去了很多时间,所以被广泛应用于在Lin ......

linux 查看文件夹大小

du -sh * 查看当前目录下的文件夹大小
du 命令
用途
概述磁盘使用。
语法
du [ -a | -s ] [ -k ] [ -m ] [ -g ][ -l ] [ -r ] [ -x ] [ -H | -L ][ File ... ]
描述
du命令显示用于文件的块的数量。
如果指定的File参数实际上是一个目录,就要报告该目录内的所有文件。如果没有提供 File参数,du命令使用当前目录 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号