Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

6)Linux³ÌÐòÉè¼ÆÈëÃÅ

6)Linux³ÌÐòÉè¼ÆÈëÃÅ--ÏûÏ¢¹ÜÀí
Ç°ÑÔ:LinuxϵĽø³ÌͨÐÅ(IPC)
LinuxϵĽø³ÌͨÐÅ(IPC)
POSIXÎÞÃûÐźÅÁ¿
System VÐźÅÁ¿
System VÏûÏ¢¶ÓÁÐ
System V¹²ÏíÄÚ´æ
1¡£POSIXÎÞÃûÐźÅÁ¿ Èç¹ûÄãѧϰ¹ý²Ù×÷ϵͳ,ÄÇô¿Ï¶¨ÊìϤPV²Ù×÷ÁË.PV²Ù×÷ÊÇÔ­×Ó
²Ù×÷.Ò²¾ÍÊDzÙ×÷ÊDz»¿ÉÒÔÖжϵÄ,ÔÚÒ»¶¨µÄʱ¼äÄÚ,Ö»Äܹ»ÓÐÒ»¸ö½ø³ÌµÄ´úÂëÔÚCPUÉÏÃæ
Ö´ÐÐ.ÔÚϵͳµ±ÖÐ,ÓÐʱºòΪÁË˳ÀûµÄʹÓúͱ£»¤¹²Ïí×ÊÔ´,´ó¼ÒÌá³öÁËÐźŵĸÅÄî. ¼ÙÉè
ÎÒÃÇҪʹÓÃһ̨´òÓ¡»ú,Èç¹ûÔÚͬһʱ¿ÌÓÐÁ½¸ö½ø³ÌÔÚÏò´òÓ¡»úÊä³ö,ÄÇô×îÖյĽá¹û»á
ÊÇʲôÄØ.ΪÁË´¦ÀíÕâÖÖÇé¿ö,POSIX±ê×¼Ìá³öÁËÓÐÃûÐźÅÁ¿ºÍÎÞÃûÐźÅÁ¿µÄ¸ÅÄî,ÓÉÓÚLi
nuxֻʵÏÖÁËÎÞÃûÐźÅÁ¿,ÎÒÃÇÔÚÕâÀï¾ÍÖ»ÊǽéÉÜÎÞÃûÐźÅÁ¿ÁË. ÐźÅÁ¿µÄʹÓÃÖ÷ÒªÊÇÓÃ
À´±£»¤¹²Ïí×ÊÔ´,ʹµÄ×ÊÔ´ÔÚÒ»¸öʱ¿ÌÖ»ÓÐÒ»¸ö½ø³ÌËùÓµÓÐ.Ϊ´ËÎÒÃÇ¿ÉÒÔʹÓÃÒ»¸öÐźÅ
µÆ.µ±ÐźŵƵÄֵΪij¸öÖµµÄʱºò,¾Í±íÃ÷´Ëʱ×ÊÔ´²»¿ÉÒÔʹÓÃ.·ñÔò¾Í±í>ʾ¿ÉÒÔʹÓÃ.
ΪÁËÌṩЧÂÊ,ϵͳÌṩÁËÏÂÃ漸¸öº¯Êý
POSIXµÄÎÞÃûÐźÅÁ¿µÄº¯ÊýÓÐÒÔϼ¸¸ö:
#include <semaphore.h>
int sem_init(sem_t *sem,int pshared,unsigned int value);
int sem_destroy(sem_t *sem);
int sem_wait(sem_t *sem);
int sem_trywait(sem_t *sem);
int sem_post(sem_t *sem);
int sem_getvalue(sem_t *sem);
sem_init´´½¨Ò»¸öÐźŵÆ,²¢³õʼ»¯ÆäֵΪvalue.pshared¾ö¶¨ÁËÐźÅÁ¿ÄÜ·ñÔÚ¼¸¸ö½ø³Ì
¼ä¹²Ïí.ÓÉÓÚÄ¿Ç°Linux»¹Ã»ÓÐʵÏÖ½ø³Ì¼ä¹²ÏíÐźŵÆ,ËùÒÔÕâ¸öÖµÖ»Äܹ»È¡0. sem_dest
royÊÇÓÃÀ´É¾³ýÐźŵƵÄ.sem_waitµ÷Óý«×èÈû½ø³Ì,Ö±µ½ÐźŵƵÄÖµ´óÓÚ0.Õâ¸öº¯Êý·µ»Ø
µÄʱºò×Ô¶¯µÄ½«ÐźŵƵÄÖµµÄ¼þÒ».sem_postºÍsem_waitÏà·´,Êǽ«ÐźŵƵÄÄÚÈݼÓһͬ
ʱ·¢³öÐźŻ½ÐѵȴýµÄ½ø³Ì..sem_trywaitºÍsem_waitÏàͬ,²»¹ý²»×èÈûµÄ,µ±ÐźŵƵÄÖµ
Ϊ0µÄʱºò·µ»ØEAGAIN,±íʾÒÔºóÖØÊÔ.sem_getvalueµÃµ½ÐźŵƵÄÖµ.
ÓÉÓÚLinux²»Ö§³Ö,ÎÒÃÇûÓа취ÓÃÔ´³ÌÐò½âÊÍÁË.
Õ⼸¸öº¯ÊýµÄʹÓÃÏ൱¼òµ¥µÄ.±ÈÈçÎÒÃÇÓÐÒ»¸ö³ÌÐòÒªÏòÒ»¸öϵͳ´òÓ¡»ú´òÓ¡Á½Ò³.ÎÒÃÇ
Ê×ÏÈ´´½¨Ò»¸öÐźŵÆ,²¢Ê¹Æä³õʼֵΪ1,±íʾÎÒÃÇÓÐÒ»¸ö×ÊÔ´¿ÉÓÃ.È»ºóÒ»¸ö½ø³Ìµ÷ÓÃse
m_waitÓÉÓÚÕâ¸öʱºòÐźŵƵÄֵΪ1,ËùÒÔÕâ¸öº¯Êý·µ»Ø,´òÓ¡»ú¿ªÊ¼´òÓ¡ÁË,ͬʱÐźŵÆ
µÄֵΪ0 ÁË. Èç¹ûµÚ¶þ¸ö½ø³ÌÒª´òÓ¡,µ÷ÓÃsem_waitʱºò,ÓÉÓÚÐźŵƵÄֵΪ0,×ÊÔ´²»¿É
ÓÃ,ÓÚÊDZ»×èÈûÁË.µ±µÚÒ»¸ö½ø³Ì´òÓ¡Íê³ÉÒÔºó,µ÷ÓÃsem_postÐźŵƵÄֵΪ1ÁË,Õâ


Ïà¹ØÎĵµ£º

°²×°Vista¡¢linux(Fedora10)¡¢Solaris

1.×¼±¸·ÖÇø
 ÓÉÓÚSolarisºÍVista(µÄÒýµ¼¼ÓÔØ)±ØÐë°²×°ÔÚÖ÷·ÖÇøÉÏ£¬linuxÊÇ¿ÉÒÔ°´ÔÚÀ©Õ¹·ÖÇøÉϵÄ
     ËùÒÔÎÒ°Ñ´ÅÅÌ·Ö³É
 30GÖ÷·ÖÇø£º°²×°Vista
 27GÖ÷·ÖÇø£º±¾À´Òª°²×°FreeBSD(Ò²±ØÐë°²×°ÔÚÖ÷·ÖÇøÉÏ,µ«ÊÇFreeBSD²»Ö§³ÖÎҵĻú×ÓËùÒÔ·ÅÆú)
 135GÀ©Õ¹·ÖÇø£ºÆäÖзֳö40GµÄÂß¼­Å̸ ......

ÔÚLinuxÉϽ»²æ±àÒëwindows³ÌÐò

ת×Ô:http://www.cublog.cn/u/12592/showart_163722.html
×î½ü¼¸Ìì¸ã wxWidgets£¬ÓÉÓÚҪͬʱ±àÒëÓ¦ÓóÌÐòµÄ Windows °æ±¾£¬ÓÖÀÁµÃÔÚÐéÄâ»úÀïÃæ±àÒë³ÌÐò£¬ÓÚÊÇÏëµ½Óý»²æ±àÒëµÄ·½Ê½ÔÚ Linux ÉϱàÒëºÃ Windows °æ±¾µÄ³ÌÐò£¬ÔÙÓà Wine »òÕßÐéÄâ»úÀ´Ö´ÐС£ÊÔÁËһϣ¬ÕâÖÖ·½·¨ºÜºÃÓ㬱ÈÔÚÐéÄâ»úÀïÃæ±àÒë³ÌÐò¿ìºÜ¶à¡£
ÎҵIJÙ×÷ ......

×Ô¼º¼ÇµÄһЩlinux³£Óö«Î÷1

²é¿´ËùÓл·¾³±äÁ¿  printenv
ÉèÖãºexport ±äÁ¿Ãû=±äÁ¿Öµ
ɾ³ý£ºunset ±äÁ¿Ãû
Èç¹ûÄãÏë²é¿´Ä³Ò»¸öÃû³ÆµÄ»·¾³±äÁ¿£¬ÃüÁîÊÇ£ºecho $»·¾³±äÁ¿Ãû£¬±ÈÈ磺
echo $ORACLE_HOME
cat ²é¿´ÃüÁî
source ÉúЧ
vi±à¼­Æ÷
ÏÈ°´esc£¬È»ºóÊäÈë :q! £¬´æÅÌÍ˳öÊäÈë :wq
2¡¢X·½Ê½:
¡¡¡¡(1). vi /etc/services # È·±£xdmcp¶Ë¿ ......

linux:ÍøÂç·þÎñÅäÖÃÖ®—NFSÅäÖùÜÀí

2.1.2 ÓÃNFSʵÏÖ×ÊÔ´¹²Ïí
Ç°Ãæ½²µÄSambaÊÇʵÏÖLinuxÖ÷»úÖ®¼ä¡¢WindowsºÍLinuxÖ®¼äʵÏÖ×ÊÔ´¹²ÏíµÄ;¾¶¡£¶øNFSÊÇʵÏÖLinuxÖ÷»úÖ®¼ä¹²ÏíµÄÁíÒ»ÖÖ;¾¶¡£NFS×îÔçʹÓÃÔÚSun·þÎñÆ÷ÉÏ£¬ÏÖÔÚÒѾ­ÒÆÖ²µ½¸÷ÖÖÀàUNIXϵͳÏÂÁË£¬WindowsÏÂÒ²ÓÐÏàÓ¦µÄ°æ±¾¡£Ïà¶ÔSamba·þÎñ£¬NFS¹²Ïí¾ßÓмòµ¥¿ìËÙµÄÌص㣬ËùÒÔÄ¿Ç°¹ã·ºÓÃÓÚÀàUNIXÖ÷»úÖ®¼äµÄ×Ê ......

3)Linux³ÌÐòÉè¼ÆÈëÃÅ

3)Linux³ÌÐòÉè¼ÆÈëÃÅ--Îļþ²Ù×÷
LinuxÏÂÎļþµÄ²Ù×÷
Ç°ÑÔ:
ÎÒÃÇÔÚÕâÒ»½Ú½«ÒªÌÖÂÛlinuxÏÂÎļþ²Ù×÷µÄ¸÷¸öº¯Êý.
ÎļþµÄ´´½¨ºÍ¶Áд
ÎļþµÄ¸÷¸öÊôÐÔ
Ŀ¼ÎļþµÄ²Ù×÷
¹ÜµÀÎļþ
----------------------------------------------------------------------------
----
1¡£ÎļþµÄ´´½¨ºÍ¶Áд
ÎÒ¼ÙÉèÄãÒѾ­ÖªµÀÁ˱ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ