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

linux¶à½ø³Ì¶àÏß³ÌÎÊÌâ

ÕâÀïΪʲô×Ó½ø³Ì´´½¨µÄÏß³ÌIDÏàͬµÄ£¿
C/C++ code:
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <pthread.h>


static int temp;
void
thread1 (void *arg)
{
pthread_t thid = pthread_self ();
printf ("thread1 Current thread's ID is %d \n", (int) thid);
printf ("thread1 ends\n");
}
void
thread3 (void *arg)
{
pthread_t thid = pthread_self ();
printf ("thread3 Current thread's ID is %d \n", (int) thid);
printf ("thread3 ends\n");
}

void
thread2 (void *arg)
{
pthread_t thid = pthread_self ();
printf ("thread2 Current thread's ID is %d\n", (int) thid);
printf ("thread2 ends\n");
}
void createthread()
{
pthread_t thid1,thid2;
if(pthread_create(&thid1, NULL, thread1, NULL) != 0) {
printf("thread creation failed\n");
exit(1);
}
if(pthread_create(&thid2, NULL, thread2, NULL) != 0) {
printf("thread creation failed\n");
exit(1);
}
}

int
main()
{
pid_t status;
int i,j;
printf ("Process Creation Study ppid= %d,pid=%d\n",getppid(),getpid());
for (i = 0; i < 4; i++)
{
status = fork ();
sleep (2);
if (status == 0)
{
printf ("Child process is running,CurPid is %d,P


Ïà¹ØÎÊ´ð£º

linux½Ì³Ì - Linux/UnixÉçÇø / ϵͳά»¤ÓëʹÓÃÇø

ÓÐʲôºÃµÄLinux½Ì³ÌÂð£¿
СµÜл¹ý~
[ÎÊÌâµãÊý:0·Ö]

google

¾Ý˵Äñ¸çµÄ˽·¿²Ë²»´í¡£

Äñ¸çµÄLinux˽·¿²Ë
¸ü¶àµÄÔÙÕâÉÏÃæÈ¥ËÑË÷һϺÜLIUNXÊé¼®»¹²»´í

ÒýÓÃ
google
Õý½â

Äñ¸çµÄLinux˽·¿²Ë  ......

LINUXÏÂÐ¶ÔØJDKÎÊÌâ

ÎÒÓÃRPM±¨°²×°ÁËÒ»¸öÀϰ汾µÄJRE£¬ºóÀ´Ïëװа汾µÄ£¬
²»¹ý£¬ÎÒ°Ñ/usr/javaĿ¼ֱ½Ó¸øÉ¾ÁË£¬
ºóÔÙ°²×°µÄʱºò£¬×ÜÊÇÌáʾ°æ±¾³åÍ»£¬
¶øÇÒÎÒÓÃRPM°üÐ¶ÔØÊ±Ò²ÕÒ²»µ½ÎļþÁË¡£
ÎÒ¶ÔLINUX²»ÊìϤ£¬Ï£Íû¸ßÊÖ°ïæ¡£
http: ......

linuxÏÂÔõÑùÈÃ×Ô¼ºÐ´µÄ³ÌÐòÔÚÈκÎĿ¼¶¼¿ÉÒÔÓÃ

ÔÚlinuxÏÂдµÄһЩС³ÌÐòºÍ½Å²½£¬Ã¿´ÎÒªÔËÐж¼ÓÐÇл»µ½ËüËùÔÚµÄĿ¼£¬
ÔõÑùÈÃËüÔÚÆäËûĿ¼Ҳ¿ÉÒÔÓÃÄØ£¿¾ÍÈçÓÃvi»òlsÕâЩÃüÁîÒ»Ñù
³¢ÊÔ¹ýÌí¼Ó»·¾³±äÁ¿£¬µ«²»³É¹¦£¬²»¶®
ûÓÐÈ˻شð

ÏñviÄÇЩ£¬ËüÃÇËùÔÚµÄĿ¼¶¼Å ......

linuxÈ¡µÃ½ø³ÌÊýÄ¿

ÔÚlinux»·¾³Ï£¬ÈçºÎÓÃCÓïÑÔÈ¡µÃϵͳµ±Ç°½ø³ÌµÄ×ÜÊý£¿
systemµ÷ÓÃÍⲿÃüÁîps -ef | wc -l µÄ¾ÍÃâ̸ÁË£¬Õâ¸öÎÒ»á
ÄÇ lzÏëÔÚÓû§¿Õ¼ä×ö»¹ÊÇÄÚºË̬×öÄØ£¿
Óû§¿Õ¼äÎÒµÄÏë·¨ÊÇͳ¼Æ/procĿ¼ÏÂÓм¸¸öÊý×ÖÎļþ¼Ð
µ±È» ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ