PHP½ø³ÌÖ®¼ä¹²Ïí±äÁ¿ÁíÒ»ÖÖ°ì·¨(2)
ÔËÐÐÕâ¸öphp½«´òÓ¡³öabc£¬²¢°ÑÔÀ´µÄ¹²ÏíÄÚ´æɾ³ý¡£
×ܽ᣺
1. ÕâÁ½Ì׺¯Êý¶¼ÊǼòµ¥Ò×Óõģ¬shmopµÄΨһºÃ´¦ÊÇ¿ÉÒÔÔÚwindowsÏÂʹÓã¬ÔÚlinuxϵĻ°ÍƼöʹÓÃshm_*ÄÇÌ׺¯Êý£¬ÒòΪÄÇÌ׺¯ÊýÔÚ²åÈë¡¢¸üÐÂÒÔ¼°¶ÁÈ¡¹²ÏíÄÚ´æÀïÃæµÄ±äÁ¿Ï൱·½±ã£¬¶øshmopÐèÒª×Ô¼ºÀ´¹æ»®¹²ÏíÄÚ´æµÄ´æ´¢½á¹¹£¬Ó¦ÓÃÆðÀ´ÉÔ΢¸´ÔÓÒ»µã¡£´ËÍ⣬ÉÏÃæµÄÀý×ÓÀïÃæÎÒÖ±½ÓÓÃÊý×Ö 12345×÷Ϊ¹²ÏíÄÚ´æµÄkey£¬Êµ¼ÊÉÏ£¬¸üΪ±ê×¼µÄ×ö·¨ÊÇʹÓÃftokº¯ÊýÀ´°ÑÒ»¸ö·¾¶×ª³ÉipcµÄkey¡£¾ßÌå×ö·¨¿ÉÒԲο¼phpÊֲᡣ
2. ÔÚʹÓÃshmopʱ£¬Èç¹ûʹÓÃÍê³ÉºóûÓнøÐÐshmop_delete()²Ù×÷£¬ÔòÏ´ζԹ²ÏíÄÚ´æ±äÁ¿ÖµµÄдÈë»áÓÐÎÊÌâ³öÏÖ£¬Èç¹ûÇ°´ÎдÈëµÄ³¤¶È¡µÏ´ÎдÈëµÄ³¤¶È£¬ÔòÖ»¸²¸ÇÇ°ÃæµÄ£¬¶àÓàµÄÄÚÈݱ£Áô¡£·´Ö®£¬Èç¹ûÇ°´ÎдÈëµÄ³¤¶È¡´Ï´ÎдÈëµÄ³¤¶È£¬Ôò¶àÓàµÄÄÚÈÝ»á×Ô¶¯×·¼Óµ½ºóÃæ¡£
3. ¹²ÏíÄÚ´æʱÐèÒªµÄkey¼°±äÁ¿¾ùΪintÀàÐÍ¡£
£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½£½
Ïà¹Ø·½·¨½éÉÜ£º
shm_attach
´ò¿ª½¨Á¢¹²ÏíÄÚ´æ¿Õ¼ä¡£
Óï·¨: int shm_attach(int key, int [memsize], int [perm]);
·µ»ØÖµ: ÕûÊý
º¯ÊýÖÖÀà: ²Ù×÷ϵͳÓë»·¾³
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÓÃÀ´´ò¿ª»òÕß½¨Á¢¹²ÏíÄÚ´æ¿Õ¼ä¡£²ÎÊý key ΪÕⲿ·ÖµÄ¼ü¡£²ÎÊý memsize ¿ÉÊ¡ÂÔ£¬±íʾËùÐè×îСµÄÄÚ´æ¿Õ¼ä (µ¥Î»Îª byte λ×é)£¬Ä¬ÈÏÖµÔÚ php3.ini »ò php.ini ÖÐµÄ sysvshm.init_mem ÅäÖã¬ÈôÎÞÅäÖÃÔòΪ 10000 bytes¡£²ÎÊý perm Òà¿ÉÊ¡ÂÔ£¬Îª¸ÃÄÚ´æ¿Õ¼äµÄʹÓÃȨÏÞ£¬Ä¬ÈÏֵΪ 666¡£·µ»ØֵΪ¹²ÏíÄÚ´æµÄID Öµ£¬¿É¹©³ÌÐòʹÓá£
shm_detach
ÖÐÖ¹¹²ÏíÄÚ´æ¿Õ¼äÁ´½Ó¡£
Óï·¨: int shm_detach(int shm_identifier);
·µ»ØÖµ: ÕûÊý
º¯ÊýÖÖÀà: ²Ù×÷ϵͳÓë»·¾³
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÓÃÀ´ÖÐÖ¹Óë¹²ÏíÄÚ´æ¿Õ¼äµÄÁ´½Ó¡£²ÎÊý shm_identifier ¼´ÎªÓûÍ£Ö¹²¿·ÖµÄ¹²ÏíÄÚ´æ ID Öµ¡£
shm_remove
Çå³ýÄÚ´æ¿Õ¼ä¡£
Óï·¨: int shm_remove(int shm_identifier);
·µ»ØÖµ: ÕûÊý
º¯ÊýÖÖÀà: ²Ù×÷ϵͳÓë»·¾³
ÄÚÈÝ˵Ã÷: ±¾º¯ÊýÓÃÀ´Çå³ý¹²ÏíÄÚ´æ¿Õ¼äµÄËùÓÐ×ÊÁÏ¡£²ÎÊý shm_identifier ¼´ÎªÓûÍ£Ö¹²¿·ÖµÄ¹²ÏíÄÚ´æ ID Öµ¡£
shm_put_var
¼ÓÈë»ò¸üÐÂÄÚ´æ¿Õ¼äÖеıäÁ¿¡£
Óï·¨: int shm_put_var(int shm_identifier, int variable_key, mixed variable);
·µ»ØÖµ: ÕûÊý
º¯ÊýÖÖÀà: ²Ù×÷ϵͳÓë»·¾³
ÄÚÈÝ˵Ã÷: ±¾º¯Êý¿ÉÓÃÀ´Ôö¼Ó»òÕßÐÞ¸ÄÄÚ´æ¿Õ¼äÖбäÁ¿Öµ¡£²ÎÊý shm_identifier ΪÓûÔö¼ÓÐ޸ĵĹ²ÏíÄÚ´æ ID Öµ¡£²ÎÊý variable_key ΪÓûÔö¼ÓÐ޸ĵıäÁ¿Ãû³Æ¼ü¡£²ÎÊý variable Ϊ±äÁ¿µÄÄÚÈÝ£¬±äÁ¿µÄÀàÐÍ¿ÉÒÔÊDZ¶¾«È·Êý (double)¡¢ÕûÊý (integer)¡¢×Ö·û´® (string) »òÕßÊÇÊý×é (array)¡£
shm_get_var
È¡µÃÄÚ´æ¿Õ¼äÖÐÖ¸¶¨µÄ±äÁ¿¡£
Óï·¨: mixed shm_get_var(int shm_identifier, int variable_key);
·µ»ØÖµ: »ìºÏÀàÐÍ×ÊÁÏ
º¯ÊýÖÖÀà: ²Ù×÷ϵͳÓë»·¾³
ÄÚÈÝ˵Ã÷: ±¾º¯Êý¿ÉÓÃÀ´È¡µÃÄÚ´æ¿Õ¼äÖÐÖ¸¶¨µÄ±äÁ¿Öµ¡£²ÎÊý shm_identifier ΪÓûÈ¡µÃµÄ¹²ÏíÄÚ´æ ID Öµ¡£²ÎÊý variable_key ΪÓûÈ¡µÃµÄ±äÁ¿Ãû³Æ¼ü¡£·µ»ØÖµ¼´ÎªÖ¸¶¨±äÁ¿¼üµÄÖµ¡£
shm_remove_var
ɾ³ýÄÚ´æ¿Õ¼äÖÐÖ¸¶¨µÄ±äÁ¿¡£
Óï·¨: int shm_remove_var(int id, int variable_key);
·µ»ØÖµ: ÕûÊý
º¯ÊýÖÖÀà: ²Ù×÷ϵͳÓë»·¾³
ÄÚÈÝ˵Ã÷: ±¾º¯Êý¿ÉÓÃÀ´É¾³ýÄÚ´æ¿Õ¼äÖÐÖ¸¶¨µÄ±äÁ¿Öµ¡£²ÎÊý shm_identifier ΪÓû³ýÈ¥µÄ¹²ÏíÄÚ´æ ID Öµ¡£²ÎÊý variable_key ΪÓûɾ³ýµÄ±äÁ¿Ãû³Æ¼ü¡£
ÍƼöÐÅÏ¢
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- php³£ÓÃÕýÔò±í´ïʽ
- phpÐÔÄܼà²âÄ£¿éXHProf
- ÈÃCI¿ò¼ÜÖ§³Öservice²ã
- ʹÓÃPHPÉú³É´øLOGOµÄ¸öÐÔ»¯¶þάÂëͼÏñ
- ¹ØÓÚCodeIgniterÄã¿ÉÄܲ»ÖªµÀµÄ5¸ö֪ʶµã
- Memcache ºÁÃ뼶³¬Ê±¼°ÆäËû³£¼ûÎÊÌâ»ã×Ü
- [PHP±Ê¼Ç]PHPQueryÒ»¸ö´¦ÀíDOMµÄÀûÆ÷
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- PHP»ñÈ¡Óû§µÄÕæʵIP£¬²¢ÅжÏÊÇ·ñÄÚÍøIP
- PHP ´íÎóÈÕÖ¾ error_log
- ÀûÓÃbigpipe»úÖÆʵÏÖÒ³ÃæÄ£¿éµÄÒì²½äÖȾ chunked¼¼Êõ
- php¿ØÖÆÎļþÏÂÔØËÙ¶È
- js + php ¶ÁÈ¡¡¢²¥·ÅÊÓƵÁ÷ ¼æÈÝfirefox£¬c....
- ¡¾ÊÓƵ²¥·Å¡¿JplayerÊÓƵ²¥·ÅÆ÷µÄʹÓÃ
- UNICODE Óë UTF-8 µÄ¹Øϵ
- memcacheÄÚ´æÔÀí
- Memcache¼¼Êõ·ÖÏí£º½éÉÜ¡¢Ê¹Óᢴ洢¡¢Ëã·¨¡¢ÓÅ»¯....
- phpʹÓÃmb_detect_encoding¼ì²â×Ö·û´®±àÂë
ÆÀÂÛ