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

Linux¶àÏ̱߳à³Ì

Ô­ÎĵØÖ· http://johnylai.blog.sohu.com/63406924.html
µäÐ͵ÄḬ̈߳üÀ¨Ò»¸öÔËÐÐʱ¼äϵͳ£¬Ëü¿ÉÒÔ°´Í¸Ã÷µÄ·½Ê½À´¹ÜÀíÏ̡߳£Í¨³£Ḭ̈߳ü°üÀ¨¶ÔÏ̵߳Ĵ´½¨ºÍɾ³ý£¬ÒÔ¼°¶Ô»¥³âºÍÌõ¼þ±äÁ¿µÄµ÷Óá£POSIX±ê×¼Ï߳̿â¾ßÓÐÕâЩµ÷Óá£ÕâЩ°ü»¹ÌṩÏ̵߳Ķ¯Ì¬´´½¨ºÍɾ³ý£¬Òò´Ë£¬Ö±µ½ÔËÐÐʱ¼ä֮ǰ£¬Ï̵߳ĸöÊý²»±ØÖªµÀ¡£
       Ï߳̾ßÓÐÒ»¸öID¡¢Ò»¸ö¶ÑÕ»¡¢Ò»¸öÖ´ÐÐÓÅÏÈȨ£¬ÒÔ¼°Ö´ÐеĿªÊ¼µØÖ·¡£POSIXÏß³Ìͨ¹ýpthread_tÀàÐ͵ÄIDÀ´ÒýÓá£pthread_tÆäʵ¾ÍÊÇÎÞ·ûºÅ³¤ÕûÐÍ£¬ÔÚÎļþ/usr/include/bits/pthreadtypes.hÓÐÈç϶¨Ò壺
       typedef unsigned long int pthread_t;
       Ï̵߳ÄÄÚ²¿Êý¾Ý½á¹¹Ò²°üº¬µ÷¶ÈºÍʹÓÃÐÅÏ¢¡£½ø³ÌµÄÏ̹߳²Ïí½ø³ÌµÄÍêÕûµØÖ·¿Õ¼ä£¬ËüÃÇÄܹ»ÐÞ¸ÄÈ«¾Ö±äÁ¿£¬·ÃÎÊ´ò¿ªµÄÎļþÃèÊö·û£¬»òÓñðµÄ·½Ê½Ï໥×÷Óá£
1¡¢  pthread_createº¯Êý
Èç¹ûÏ߳̿ÉÔÚ½ø³ÌµÄÖ´ÐÐÆÚ¼äµÄÈÎÒâʱ¿Ì±»´´½¨£¬²¢ÇÒÏ̵߳ÄÊýÁ¿ÊÂÏÈûÓбØÒªÖ¸¶¨£¬ÕâÑùµÄÏ̳߳ÆΪ¶¯Ì¬Ï̡߳£ÔÚPOSIXÖУ¬Ïß³ÌÊÇÓÃpthread_create¶¯Ì¬µÄ´´½¨µÄ¡£pthread_createÄÜ´´½¨Ị̈߳¬²¢½«Ëü·ÅÈë¾ÍÐ÷¶ÓÁС£´´½¨Ïß³ÌÐèÒªµ÷ÓÃpthread_create£¬¸Ãº¯ÊýµÄ¶¨ÒåÈçÏÂËùʾ£º
#include <pthread.h>
int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void*(*start_routine)(void *),void *arg);
¸Ãº¯ÊýµÄµÚ1¸ö²ÎÊýthread½«Ö¸Ïò´´½¨Ï̵߳ÄID¡£Ï̵߳ÄÊôÐÔÊÇÓÉattrÖ¸ÏòµÄÊôÐÔ¶ÔÏóÀ´°üÈݵġ£Èç¹ûattrΪNULL£¬ÐÂÏ߳̾ßÓÐȱʡµÄÊôÐÔ¡£µÚ3¸ö²ÎÊýstart_routineÊÇÏ߳̿ªÊ¼Ö´ÐÐʱµ÷Óõĺ¯ÊýÃû×Ö¡£start_routineÕ¼ÓÃÒ»¸ö²ÎÊýarg£¬ËüÊÇÒ»¸öÖ¸ÏòviodµÄÖ¸Õë¡£start_routine·µ»ØÒ»¸öÖ¸ÏòviodµÄÖ¸Õ룬´ËÖ¸Õë±»¿Õ×÷ʱpthread_jionµÄÍ˳ö״̬¡£
º¯Êýpthread_createÔڳɹ¦µ÷ÓÃʱ·µ»Ø0£¬Ê§°Üʱ·µ»Ø-1¡£
2¡¢  pthread_selfº¯Êý
ÔÚ´´½¨Ïß³ÌÖ®ºó£¬¿ÉÒÔµ÷ÓÃpthread_selfµÃµ½Ï̵߳ÄID£¬¸Ãº¯ÊýµÄ¶¨ÒåÈçÏÂËùʾ£º
#include <pthread.h>
pthread_t pthread_self(void);
3¡¢  pthread_exitº¯Êý
Óë½ø³ÌÍ˳öʱµ÷ÓÃexitÀàËÆ£¬Ïß³ÌÍ˳öʱҲÐèÒªµ÷ÓÃpthread_exit£¬ËüµÄ¶¨ÒåÈçÏ£º
#include <pthread.h>
void pthread_exit(void* retval);
º¯Êýpthread_exitÖÕÖ¹µ÷ÓõÄÏ̡߳£²ÎÊýretvalµÄÖµ¶Ôpthread_joinº¯ÊýµÄ³É¹¦ÓÉʵ¼ÊÒâÒ塣Ȼ¶ø£¬pthread_exitµÄretval±ØÐëÖ¸¶¨£¬ÔÚÏß³ÌÍ˳öʱËü²


Ïà¹ØÎĵµ£º

LinuxÍø¹Ü±Ê¼Ç£¨24£©ÖØÐÂÕÒµ½MySQLÊý¾Ý¿âµÄrootÃÜÂë

Íü¼ÇMySQL ROOTÃÜÂëÊÇÔÚMySQLʹÓÃÖкܳ£¼ûµÄÎÊÌ⡣ûÏëµ½½ñÌì¾ÍÅöµ½ÕâÑùÒ»¸öÎÊÌ⣺ÄÚ²¿µÄmysqlµÄrootÃÜÂë±»ÐÞ¸ÄÁË¡£²éÔÄ×ÊÁÏ£¬ÓÐÈçÏ·½·¨£º Unix&Linux£º
1.ÓÃroot»òÕßÔËÐÐmysqldµÄÓû§µÇ¼ϵͳ£»
2£®ÀûÓÃkillÃüÁî½áÊøµômysqldµÄ½ø³Ì£»
3£®Ê¹ÓÃ--skip-grant-tables²ÎÊýÆô¶¯MySQL Server
shell& ......

¡¾VNC¡¿Linux»·¾³VNC·þÎñ°²×°¡¢ÅäÖÃÓëʹÓÃ

 1.È·ÈÏVNCÊÇ·ñ°²×°
ĬÈÏÇé¿öÏ£¬Red Hat Enterprise Linux°²×°³ÌÐò»á½«VNC·þÎñ°²×°ÔÚϵͳÉÏ¡£
È·ÈÏÊÇ·ñÒѾ­°²×°VNC·þÎñ¼°²é¿´°²×°µÄVNC°æ±¾
[root@testdb ~]# rpm -q vnc-server
vnc-server-4.1.2-9.el5
[root@testdb ~]#
ÈôϵͳûÓа²×°,¿ÉÒÔµ½²Ù×÷ϵͳ°²×°Å̵ÄServerĿ¼ÏÂÕÒµ½VNC·þÎñµÄRPM°²×°°üvnc-server- ......

linuxÏ oracleµÄ°²×°

  °²×°×¼±¸£º
ÏÂÔØÎļþ
l         Oracle Database 10g Release 2(10.2.0.1) Software
½âѹÎļþ
½âѹÎļþÃüÁ
unzip 10201_database_linux32.zip
½âѹºóµÄÎļþ¼Ð¿ÉÄÜ“database”»ò“db/Disk1”
HostsÎļþ
ÔÚ/etc/hosts ÎļþÖаüº¬Ò»¸öÍêÕûºÏ· ......

linuxÏ¿ìËÙ°²×°apache+php+mysql

 £¨1£©¡¢yum°²×°mysql
//yum°²×°
yum -y install mysql mysql_server
//ÔÚ·þÎñÇåµ¥ÖÐÌí¼Ómysql·þÎñ
chkconfig --add mysqld
//·þÎñÆô¶¯
service mysqld start
//³õʼ»¯mysqlÊý¾Ý¿â
/usr/bin/mysql_secure_installation
£¨2£©¡¢°²×°apache
yum -y install httpd
service httpd start
Ìí¼ÓiptablesÔÊÐí·Ã ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ