Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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±à³Ìʵս֮Îļþϵͳ±à³Ì

ÎÄÕÂÀ´Ô´£ºhttp://dev.yesky.com/468/7601968.shtml
2007-10-12 11:01×÷ÕߣºËᦻª³ö´¦£ºÌ켫ÍøÈí¼þƵµÀÔðÈα༭£º·½ÖÛ
1.LinuxÎļþϵͳ
¡¡¡¡LinuxÖ§³Ö¶àÖÖÎļþϵͳ£¬Èçext¡¢ext2¡¢minix¡¢iso9660¡¢msdos¡¢fat¡¢vfat¡¢nfsµÈ¡£ÔÚÕâЩ¾ßÌåÎļþϵͳµÄÉϲ㣬LinuxÌṩÁËÐéÄâÎļþϵͳ£¨VFS£©À´Í³Ò»ËüÃǵÄÐÐΪ£¬ÐéÄâÎļþϵͳΪ ......

Linux×ÀÃæºÎ´¦È¥£¿






<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
    µ±Ç°£¬Ò»¸öºÜÃ÷ÏÔµÄÊÂʵÊÇ£¬
Linux
×ÀÃæ²¢²»ÆÕ¼°¡£Ô­ÒòºÎÔÚ£¿

ÔÚ
XP
µÁ°æº£ÑóÖУ¬ÆÕ¼°
Linux
£¬Ì¸ºÎÈÝÒ×£¿Ê®¼¸ÄêÁË£¬Ëµ¾¡
XP
µÁ°æµÄ»µ»°Ò²ÎÞÓ㨲»ÁéÑ飩¡£
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ÏÂrar¸ñʽÎļþ½âѹ·½·¨£¨ubuntu9ϲËÄñ¼¶·½·¨£©

×î½ü¸Õ½Ó´¥linux £¬¶ÔÕâ¸öϵͳÊÇÒ»µã¶¼²»Á˽⣬µ«ÊÇÓÉÓÚÍøÉÏÏÂÔصÄ×ÊÔ´¶àÊÇ.rar¸ñʽµÄ£¬ËùÒÔÈçºÎ½âѹÕâ¸öÎļþÊÇÎÒÓöµ½µÄÒ»¸öÄÑÌâ¡£
ÔÚÍøÉÏËÑÁËЩÏà¹Ø·½·¨£¬Ô­ÎÄÈçÏ£º
LinuxϵͳÖÐrar¡¢unrarÃüÁî°²×°ºÍʹÓÃÏê½â
×÷Õß:Van<hexinghe@hotmail.com>
˵Ã÷£ºÓÉÓÚ±¾ÈËˮƽÓÐÏÞ£¬ÄÑÃâÓдíÎóÖ®´¦¡£»¶Ó­×ªÔØ£¬µ«Çë×¢Ã÷×÷ÕßÐ ......

linux socket±à³ÌÒ»°ãģʽ

1£ºËùÐèÍ·Îļþ£º<systypes.h>£¨Êý¾ÝÀàÐͶ¨Ò壩  < sys/socket.h>£¨Ìṩsocketº¯ÊýºÍÊý¾Ý½á¹¹£©
    <netinet/in.h>£¨¶¨ÒåÊý¾Ý½á¹¹sockaddr_in£© <netdb.h>£¨Ìṩ»ñÈ¡ÓòÃû»òIPµÄº¯Êý£© 
    <arpa/inet.h>£¨ÌṩIPµØַת»»º¯Êý£©  < ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ