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

Linux ½ø³Ì¹ÜÀíÆÊÎö

ÎÄÕÂÀ´Ô´£ºhttp://www.ibm.com/developerworks/cn/linux/l-linux-process-management/
¼¶±ð£º Öм¶
M. Tim Jones, ¹ËÎʹ¤³Ìʦ, Emulex Corp.
2009 Äê 1 ÔÂ 20 ÈÕ
Linux® µÄÓû§¿Õ¼ä½ø³ÌµÄ´´½¨ºÍ¹ÜÀíËùÉæ¼°µÄÔ­ÀíÓë UNIX® Óкܶ๲ͬµã£¬µ«Ò²ÓÐһЩÌض¨ÓÚ Linux µÄ¶ÀÌØÖ®´¦¡£ÔÚ±¾ÎÄÖУ¬Á˽â Linux ½ø³ÌµÄÉúÃüÖÜÆÚ£¬Ì½Ë÷Óû§½ø³Ì´´½¨¡¢ÄÚ´æ¹ÜÀí¡¢µ÷¶ÈºÍÏú»ÙµÄÄÚºËÄÚÄ»¡£
Linux ÊÇÒ»ÖÖ¶¯Ì¬ÏµÍ³£¬Äܹ»ÊÊÓ¦²»¶Ï±ä»¯µÄ¼ÆËãÐèÇó¡£Linux ¼ÆËãÐèÇóµÄ±íÏÖÊÇÒÔ½ø³Ì µÄͨÓóéÏóΪÖÐÐĵġ£½ø³Ì¿ÉÒÔÊǶÌÆڵģ¨´ÓÃüÁîÐÐÖ´ÐеÄÒ»¸öÃüÁ£¬Ò²¿ÉÒÔÊdz¤Æڵģ¨Ò»ÖÖÍøÂç·þÎñ£©¡£Òò´Ë£¬¶Ô½ø³Ì¼°Æäµ÷¶È½øÐÐÒ»°ã¹ÜÀí¾ÍÏԵü«ÎªÖØÒª¡£
ÔÚÓû§¿Õ¼ä£¬½ø³ÌÊÇÓɽø³Ì±êʶ·û£¨PID£©±íʾµÄ¡£´ÓÓû§µÄ½Ç¶ÈÀ´¿´£¬Ò»¸ö PID ÊÇÒ»¸öÊý×ÖÖµ£¬¿ÉΩһ±êʶһ¸ö½ø³Ì¡£Ò»¸ö PID ÔÚ½ø³ÌµÄÕû¸öÉúÃüÆڼ䲻»á¸ü¸Ä£¬µ« PID ¿ÉÒÔÔÚ½ø³ÌÏú»Ùºó±»ÖØÐÂʹÓã¬ËùÒÔ¶ÔËüÃǽøÐлº´æ²¢²»¼ûµÃ×ÜÊÇÀíÏëµÄ¡£
ÔÚÓû§¿Õ¼ä£¬´´½¨½ø³Ì¿ÉÒÔ²ÉÓü¸ÖÖ·½Ê½¡£¿ÉÒÔÖ´ÐÐÒ»¸ö³ÌÐò£¨Õâ»áµ¼ÖÂнø³ÌµÄ´´½¨£©£¬Ò²¿ÉÒÔÔÚ³ÌÐòÄÚ£¬µ÷ÓÃÒ»¸ö fork »ò exec ϵͳµ÷Óá£fork µ÷ÓûᵼÖ´´½¨Ò»¸ö×Ó½ø³Ì£¬¶ø exec µ÷ÓÃÔò»áÓÃгÌÐò´úÌ浱ǰ½ø³ÌÉÏÏÂÎÄ¡£½ÓÏÂÀ´£¬ÎÒ½«¶ÔÕ⼸ÖÖ·½·¨½øÐÐÌÖÂÛÒÔ±ãÄúÄܺܺõØÀí½âËüÃǵŤ×÷Ô­Àí¡£
ÔÚ±¾ÎÄÖУ¬ÎÒ½«°´ÕÕÏÂÃæµÄ˳ÐòÕ¹¿ª¶Ô½ø³ÌµÄ½éÉÜ£¬Ê×ÏÈչʾ½ø³ÌµÄÄں˱íʾÒÔ¼°ËüÃÇÊÇÈçºÎÔÚÄÚºËÄÚ±»¹ÜÀíµÄ£¬È»ºóÀ´¿´¿´½ø³Ì´´½¨ºÍµ÷¶ÈµÄ¸÷ÖÖ·½Ê½£¨ÔÚÒ»¸ö»ò¶à¸ö´¦ÀíÆ÷ÉÏ£©£¬×îºó½éÉܽø³ÌµÄÏú»Ù¡£
½ø³Ì±íʾ
ÔĶÁ developerWorks ÉÏ Tim Jones Ëù׫дµÄ¸ü¶àÎÄÕÂ
Tim µÄÆÊÎö…… ϵÁÐÎÄÕÂ
ÔÚ Linux ÄÚºËÄÚ£¬½ø³ÌÊÇÓÉÏ൱´óµÄÒ»¸ö³ÆΪ task_struct µÄ½á¹¹±íʾµÄ¡£´Ë½á¹¹°üº¬ËùÓбíʾ´Ë½ø³ÌËù±ØÐèµÄÊý¾Ý£¬´ËÍ⣬»¹°üº¬ÁË´óÁ¿µÄÆäËûÊý¾ÝÓÃÀ´Í³¼Æ£¨accounting£©ºÍά»¤ÓëÆäËû½ø³ÌµÄ¹Øϵ£¨¸¸ºÍ×Ó£©¡£¶Ô task_struct µÄÍêÕû½éÉܳ¬³öÁ˱¾Îĵķ¶Î§£¬Çåµ¥ 1 ¸ø³öÁË task_struct µÄһС²¿·Ö¡£ÕâЩ´úÂë°üº¬Á˱¾ÎÄËùҪ̽Ë÷µÄÕâЩÌض¨ÔªËØ¡£task_struct λÓÚ ./linux/include/linux/sched.h¡£
Çåµ¥ 1. task_struct µÄһС²¿·Ö

struct task_struct {
volatile long state;
void *stack;
unsigned int flags;
int prio, static_prio;
struct list_head tasks;
struct mm_struct *mm, *active_mm;
pid_t pid;
pid_t tgid;
struct task_struct *real_parent;
char comm[TASK_


Ïà¹ØÎĵµ£º

linux£ºDynamic MMap ran out of room

    µ±ÎÒµÄubuntu½øÐÐÈç³£µÄ¸üÐÂʱ£¬Í»È»¸æËßÎÒDynamic MMap ran out of room.È»ºógoogleµÃ½â·¨£¬¼Ç¼ÈçÏ£º
    sudo gedit /etc/apt/apt.conf.d/70debconf
    ÔöÌíÒÔÏÂÁ½ÐУºAPT::Cache-Limit "200000000";
       &nbs ......

´´½¨linuxµÄ·þÎñ³ÌÐò

´´½¨linux·þÎñ£¬Ê¹µÃtest client¿ÉÒÔ¿ª»úÆô¶¯£¬²½ÖèÈçÏ£º
 
1.´´½¨Ä¿Â¼/usr/local/test/
2.¸´ÖÆtestcµ½/usr/local/test/
3.±àдÎļþ/etc/init.d/testc.sh
testc.sh
--------------------begin(not included)-----------------------
 
#! /bin/sh
#
### BEGIN INIT INFO
# Provides:  &nbs ......

linuxÏÂapache+php°²×°³£¼ûÎÊÌâ


linuxÏÂapache+php°²×°³£¼ûÎÊÌâ
configure: error: Unable to find libgd.(a|so)
Èç¹ûʹÓõÄÊÇubuntu»òdebian¾ÍºÜ¼òµ¥ÁË£¬Ö±½Ósudo apt-get install apache2 libapache2-mod-php5 php5 php5-gd ¾Í»ù±¾Éϸ㶨£¬µ«ÊÇÓÃÔ´´úÂë°²×°»¹ÊǺÜÂé·³¡«
wget http://www.boutell.com/gd/http/gd-2.0.11.tar.gz
tar zxvf gd-2.0.11 ......

LinuxÖ¸ÒýÎÒÃÇ×ßÏòºÎ·½£¿






<!--
@page { margin: 2cm }
P { margin-bottom: 0.21cm }
-->
    ½üÆÚÒÔÀ´£¬¾²¹ÛÊÀ½ç
Linux
Òµ½çµÄ¸÷ÖÖ¶¯Ïò£¬ÁîÈËÐÄÈç³±Ó¿£¬²»µÃ°²Äþ¡£´Ë»°Ôõô½²£¿
 
    Ê®¼¸ÄêÀ´£¬
Linux
ÒѾ­ÐγÉÒ»¹ÉÊÀ½çÐԵķ¢Õ¹³±Á÷£¬ÈκÎÊÆÁ¦Ò²×èµ²²»ÁË¡£Ðí¶àÊÀ½ç¼¶µÄ´ó¹ ......

linux¹Ø»úÃüÁîÏê½â

ÔÚlinuxÏÂһЩ³£ÓõĹػú/ÖØÆôÃüÁîÓÐshutdown¡¢halt¡¢reboot¡¢¼°init£¬ËüÃǶ¼¿ÉÒÔ´ïµ½ÖØÆôϵͳµÄÄ¿µÄ£¬µ«Ã¿¸öÃüÁîµÄÄÚ²¿¹¤×÷¹ý³ÌÊDz»Í¬µÄ£¬Í¨¹ý±¾ÎĵĽéÉÜ£¬Ï£ÍûÄã¿ÉÒÔ¸ü¼ÓÁé»îµÄÔËÓø÷ÖֹػúÃüÁî¡£
¡¡¡¡1.shutdown
¡¡¡¡shutdownÃüÁȫµØ½«ÏµÍ³¹Ø»ú¡£ÓÐЩÓû§»áʹÓÃÖ±½Ó¶ÏµôµçÔ´µÄ·½Ê½À´¹Ø±Õlinux£¬ÕâÊÇÊ®·ÖΣÏյġ£ÒòÎ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ