Linux½ø³Ì¼äͨѶ֮¹²ÏíÄÚ´æ
¹²ÏíÄÚ´æ:
ʹÓù²ÏíÄÚ´æºÍʹÓÃmalloc()À´·ÖÅäÄÚ´æÇøÓòºÜÏàËÆ¡£Ê¹Óù²ÏíÄÚ´æµÄ·½·¨ÊÇ£º
1 ¶ÔÒ»¸ö½ø³Ì/Ïß³ÌʹÓÃshmget()·ÖÅäÄÚ´æÇøÓò¡£
2 ʹÓÃshmat()·ÅÖÃÒ»¸ö»ò¶à¸ö½ø³Ì/Ïß³ÌÔÚ¹²ÏíÄÚ´æÖУ¬Ò²¿ÉÒÔÓÃshmctl()À´»ñÈ¡ÐÅÏ¢»òÕß¿ØÖƹ²ÏíÇøÓò¡£
3 ʹÓÃshmdt()´Ó¹²ÏíÇøÓòÖзÖÀë¡£
4 ʹÓÃshmctl()½â³ý·ÖÅä¿Õ¼ä
¹²ÏíÄÚ´æÊÇLinuxÖÐ×î¿ìËÙµÄIPC·½·¨¡£ËüÒ²ÊÇÒ»¸öË«Ïò¹ý³Ì£¬¹²ÏíÇøÓòÄÚµÄÈκνø³Ì¶¼¿ÉÒÔ¶ÁдÄÚ´æ¡£Õâ¸ö»úÖÆµÄ²»Àû·½ÃæÊÇÆäͬ²½ºÍÐÒé¶¼²»ÊܳÌÐòÔ±¿ØÖÆ£¬±ØÐëÈ·±£½«¾ä±ú´«µÝ¸øÁË×Ó½ø³ÌºÍÏ̡߳£
Ò». º¯Êý£º shmget½éÉÜ
¹¦ÄÜ:È¡µÃ¹²ÏíÄÚ´æ¶Î
Óï·¨:#include <sys/types.h>;
#include <sys/ipc.h>;
#include <sys/shm.h>;
int shmget(key,size,shmflg)
key_t key;
int size,shmflg;
˵Ã÷:±¾ÏµÍ³µ÷Ó÷µ»ØkeyÏà¹ØµÄ¹²ÏíÄÚ´æ±êʶ·û.
¹²ÏíÄÚ´æ±êʶ·ûºÍÏà¹ØÊý¾Ý½á¹¹¼°ÖÁÉÙsize×ֽڵĹ²ÏíÄÚ´æ¶ÎÄÜ
Õý³£´´½¨,ÒªÇóÒÔÏÂÊÂʵ³ÉÁ¢:
. ²ÎÊýkeyµÈÓÚIPC_PRIVATE.
. ²ÎÊýkeyûÓÐÏà¹ØµÄ¹²ÏíÄÚ´æ±êʶ·û,ͬʱ(shmflg&IPC_CREAT)
ÖµÎªÕæ.
¹²ÏíÄÚ´æ´´½¨Ê±,ÐÂÉú³ÉµÄ¹²ÏíÄÚ´æ±êʶÏà¹ØµÄÊý¾Ý½á¹¹±»³õʼ
Ïà¹ØÎĵµ£º
Ò»¡¢ÏÂÔØjdk1.5
´Óhttp://www.sun.com/ÍøÕ¾ÏÂÔØjdk1.5
ÏÂÔØ£ºjdk-1_5_0_15-linux-i586-rpm.bin
¶þ¡¢°²×°jdk
1.
# chmod +x jdk-1_5_0_15-linux-i586-rpm.bin
# ./jdk-1_5_0_15-linux-i586-rpm.bin
°´Ìáʾ°´ÊäÈëyes,ÔÚͬһĿ¼»áµÃµ½Ò»¸öjdk-1_5_0_15-linux-i586-rpm
ͨ¹ý# rpm –ivh jdk-1 ......
ÍøÉÏÕÒÁËÏÂLinux½ø³Ì¼ä»¥³âµÄʵÏÖ£¬Á½ÖÖ·½·¨£¬semaphore ºÍ ÎļþËø¡£¸Õ¿ªÊ¼Ò²³¢ÊÔÓÃsemaphoreÀ´ÊµÏÖ£¬µ«·¢ÏÖsem_waitºÍsingalÎÞ·¨ÊµÏÖWindowsÏÂCirtSec£¬¶ø²ÉÓÃÁ˺óÕßÎļþËø£»
µ«¶ÔÓÚ¶ÁÐ´ËøÀ´ËµÊµÓÃÎļþËøÊµÏÖ£¬´æÔÚÒ»¶¨µÄ²»×㣬Ëü·Ö¿ªÁ˶ÁÐ´Ëø£¬¶øÃ»Óзֿª½â¶ÁÐ´Ëø£¬ÀûÓÃUnLockÀ´Í³Ò»½â¶ÁÐ´Ëø£¬¶ÔÓÚÕâ½ø³Ì¼ä¶ÁÐ´ËøµÄʵÏÖ£ ......
<Ctrl><Alt><F1>
Çл»µ½µÚÒ»¸öÎı¾ÖÕ¶Ë¡£ÔÚLinuxÏÂÄã¿ÉÒÔÓжà´ïÁù¸ö²»Í¬µÄÖÕ¶Ë¡£Õâ¸öÃüÁîµÄÒâ˼ÊÇ£º“ͬʱ°´×¡<Ctrl>¼üºÍ<Alt>¼ü£¬È»ºó°´<F1>¼ü£¬ÔÙÊÍ·ÅËùÓеļü”¡£
<Ctrl><Alt><Fn> (n=1..6)
Çл»µ½µÚn¸öÎı¾ÖÕ¶Ë¡££¨ÄãÒ²¿ÉÒÔʹÓò»ÊǺܾ³£Óõ½µÄ ......
¹ÜµÀ¼°ÓÐÃû¹ÜµÀ
ÔÚ±¾ÏµÁÐÐòÖÐ×÷Õ߸ÅÊöÁË linux ½ø³Ì¼äͨÐŵļ¸ÖÖÖ÷ÒªÊֶΡ£ÆäÖйܵÀºÍÓÐÃû¹ÜµÀÊÇ×îÔçµÄ½ø³Ì¼äͨÐÅ»úÖÆÖ®Ò»£¬¹ÜµÀ¿ÉÓÃÓÚ¾ßÓÐÇ×Ôµ¹ØÏµ½ø³Ì¼äµÄͨÐÅ£¬ÓÐÃû¹ÜµÀ¿Ë·þÁ˹ܵÀûÓÐÃû×ÖµÄÏÞÖÆ£¬Òò´Ë£¬³ý¾ßÓйܵÀËù¾ßÓеŦÄÜÍ⣬Ëü»¹ÔÊÐíÎÞÇ×Ôµ¹ØÏµ½ø³Ì¼äµÄͨÐÅ¡£ ÈÏÇå¹ÜµÀºÍÓÐÃû¹ÜµÀµÄ¶Áд¹æÔòÊÇÔÚ³ÌÐòÖÐÓ¦Ó ......
Linux ÎļþºÍĿ¼µÄÊôÐÔ
×÷Õߣº±±ÄÏÄϱ±
À´×Ô£ºhttp://www.linuxsir.org/main/?q=node/196
ÕªÒª£º±¾ÎĽ²ÊöµÄÊÇÎļþ»òĿ¼µÄÊôÐÔ£¬±ÈÈç½Úµãinode¡¢ÎļþÀàÐÍ¡¢ÎļþȨÏÞ¼°¹éÊô£»»¹¶Ôsetuid¡¢setgid¼°Õ³Ìùλ½øÐÐÁËÒ»°ãÐԵĽ²½â¡£¶Ôln
¡¢chmod¡¢umask¡¢chown¡¢chgrp ¡¢touch µÄÓ÷¨Ò²½øÐÐÁ˱ȽÏÏêϸµÄ˵Ã÷ºÍ¾ÙÀý£»
Ŀ¼ ......