linux Ï̱߳à³Ì
±¾Õ½éÉÜ POSIX Ï̵߳Ļù±¾Ï̱߳à³ÌÀý³Ì¡£±¾Õ½éÉÜȱʡỊ̈߳¨¼´£¬¾ßÓÐȱʡÊôÐÔÖµµÄỊ̈߳©£¬ÕâÊǶàÏ̱߳à³ÌÖÐ×î³£ÓõÄÏ̡߳£±¾Õ»¹½éÉÜÈçºÎ´´½¨ºÍʹÓþßÓзÇȱʡÊôÐÔµÄÏ̡߳£
±¾Õ½éÉÜµÄ POSIX Àý³Ì¾ßÓÐÓë×î³õµÄ Solaris ¶àÏ߳̿âÏàËƵıà³Ì½Ó¿Ú¡£
Ï߳̿â
ÏÂÃæ¼òÒªÂÛÊöÁËÌض¨ÈÎÎñ¼°ÆäÏà¹ØÊÖ²áÒ³¡£
´´½¨È±Ê¡Ïß³Ì
Èç¹ûδָ¶¨ÊôÐÔ¶ÔÏó£¬Ôò¸Ã¶ÔÏóΪ NULL£¬ÏµÍ³»á´´½¨¾ßÓÐÒÔÏÂÊôÐÔµÄȱʡỊ̈߳º
½ø³Ì·¶Î§
·Ç·ÖÀë
ȱʡջºÍȱʡջ´óС
ÁãÓÅÏȼ¶
»¹¿ÉÒÔÓà pthread_attr_init() ´´½¨È±Ê¡ÊôÐÔ¶ÔÏó£¬È»ºóʹÓøÃÊôÐÔ¶ÔÏóÀ´´´½¨È±Ê¡Ï̡߳£ÓйØÏêϸÐÅÏ¢£¬Çë²Î¼û³õʼ»¯ÊôÐÔÒ»½Ú¡£
pthread_create Óï·¨
ʹÓà pthread_create(3C) ¿ÉÒÔÏòµ±Ç°½ø³ÌÖÐÌí¼ÓеÄÊÜ¿ØÏ̡߳£
int pthread_create(pthread_t *tid, const pthread_attr_t *tattr,
void*(*start_routine)(void *), void *arg);
#include <pthread.h>
pthread_attr_t() tattr;
pthread_t tid;
extern void *start_routine(void *arg);
void *arg;
int ret;
/* default behavior*/
ret = pthread_create(&tid, NULL, start_routine, arg);
/* initialized with default attributes */
ret = pthread_attr_init(&tattr);
/* default behavior specified*/
ret = pthread_create(&tid, &tattr, start_routine, arg);
ʹÓþßÓбØҪ״̬ÐÐΪµÄ attr µ÷Óà pthread_create() º¯Êý¡£ start_routine ÊÇÐÂÏß³Ì×îÏÈÖ´Ðеĺ¯Êý¡£µ± start_routine ·µ»Øʱ£¬¸ÃÏ߳̽«Í˳ö£¬ÆäÍ˳ö״̬ÉèÖÃΪÓÉ start_routine ·µ»ØµÄÖµ¡£Çë²Î¼ûpthread_create Óï·¨¡£
µ± pthread_create() ³É¹¦Ê±£¬Ëù´´½¨Ïß³ÌµÄ ID ±»´æ´¢ÔÚÓÉ tid Ö¸ÏòµÄλÖÃÖС£
ʹÓà NULL ÊôÐÔ²ÎÊý»òȱʡÊôÐÔµ÷Óà pthread_create() ʱ£¬pthread_create() »á´´½¨Ò»¸öȱʡÏ̡߳£ÔÚ¶Ô tattr ½øÐгõʼ»¯Ö®ºó£¬¸ÃÏ߳̽«»ñµÃȱʡÐÐΪ¡£
pthread_create ·µ»ØÖµ
pthread_create() ÔÚµ÷Óóɹ¦Íê³ÉÖ®ºó·µ»ØÁã¡£ÆäËûÈκηµ»ØÖµ¶¼±íʾ³öÏÖÁË´íÎó¡£Èç¹û¼ì²âµ½ÒÔÏÂÈÎÒ»Çé¿ö£¬pthread_create() ½«Ê§°Ü²¢·µ»ØÏàÓ¦µÄÖµ¡£
EAGAIN
ÃèÊö:
³¬³öÁËϵͳÏÞÖÆ£¬Èç´´½¨µÄÏß³ÌÌ«¶à¡£
EINVAL
ÃèÊö:
tattr µÄÖµÎÞЧ¡£
µÈ´ýÏß³ÌÖÕÖ¹
pthread_join() º¯Êý»áÒ»Ö±×èÈûµ÷ÓÃỊ̈߳¬Ö±µ½Ö¸¶¨µÄÏß³ÌÖÕÖ¹¡£
pthread_join Óï·¨
ʹÓà pthread_join(3C) µÈ´ýÏß³ÌÖÕÖ¹¡£
int pthread_join(thread_t tid, void **status);
#include <pthread
Ïà¹ØÎĵµ£º
arch\arm\kernel\head.S
¸ÃÎļþĩβ°üº¬ÁËÓï¾ä£º#include "head-common.S"£¬__lookup_processor_typeº¯ÊýÔÚarch\arm\kernel\head-common.SÖж¨Òå¡£
¹Ø¼üÊý¾Ý½á¹¹£ºstruct proc_info_list£¬ÔÚarch\arm\include\asm\procinfo.hÎļþÖж¨Ò壬Cortex¶Ô´ËÊý¾Ý½á¹¹µÄÌî³äÔÚarch\arm\mm\proc-v7.sÎļþÖж¨Òå¡£
head.sÖУ¬kernelµ ......
linux—selectÏê½â
selectϵͳµ÷ÓÃʱÓÃÀ´ÈÃÎÒÃǵijÌÐò¼àÊÓ¶à¸öÎļþ¾ä±úµÄ״̬±ä»¯µÄ¡£³ÌÐò»áÍ£ÔÚselectÕâÀïµÈ´ý£¬Ö±µ½±»¼àÊÓµÄÎļþ¾ä±úÓÐÒ»¸ö»ò¶à¸ö·¢ÉúÁË״̬¸Ä±ä¡£
¹ØÓÚÎļþ¾ä±ú£¬Æäʵ¾ÍÊÇÒ»¸öÕûÊý£¬Í¨¹ýsocketº¯ÊýµÄÉùÃ÷¾ÍÃ÷°×ÁË£º
int socket(int domain, int type, int protocol);
ÎÒÃÇ×îÊìϤµÄ¾ä±úÊÇ0¡¢1¡¢2 ......
[ת]linuxÆô¶¯Ê±¹ÒÔØrootfsµÄ¼¸ÖÖ·½Ê½
Ò»Ö±¶ÔlinuxÆô¶¯Ê±¹ÒÔظùÎļþϵͳµÄ¹ý³Ì´æÔÚןܶàÒÉÎÊ£¬½ñÌìÔÚˮľ¾«»ªÇøÕÒµ½ÁËÓÐÓõÄ×ÊÁÏ£¬ÕªÂ¼ÈçÏ£º
1¡£linuxÆô¶¯Ê±£¬¾¹ýһϵÁгõʼ»¯Ö®ºó£¬ÐèÒªmount ¸ùÎļþϵͳ£¬Îª×îºóÔËÐÐinit½ø³ÌµÈ×ö×¼±¸£¬mount
¸ùÎļþϵͳÓÐÕâô¼¸ÖÖ·½Ê½£º
1£©ÎļþϵͳÒѾ´æÔÚÓÚÓ²ÅÌ£¨»òÕßÀàËƵÄÉ豸 ......
LinuxϵͳԽÀ´Ô½Êܵ½µçÄÔÓû§µÄ»¶Ó£¬ÓÚÊǺܶàÈË¿ªÊ¼Ñ§Ï°Linuxʱ£¬Ôںܶàʱºò£¬ÎÒÃÇÐèÒª½«ÔÚLinux×ÀÃæÉϵIJÙ×÷¹ý³Ì¼ÖÆÏÂÀ´£¬±ÈÈçÖÆ×÷ÆÁÄ»
ÑÝʾ¡¢ÊÓƵ½ÌѧµÈ¡£ÕâÀォ½éÉÜÔÚLinux×ÀÃæÏÂÖµµÃʹÓõÄ5¸öÆÁĻ¼ÏñÈí¼þ£¬°üÀ¨Istanbul¡¢Wink¡¢Xvidcap¡¢Vnc2swf¡¢
Recordmydesktop£¬Ï£Íû¶ÔÓдËÐèÇóµÄÅóÓÑÌṩ²Î¿¼¡£
¡¡¡¡Istanbul ......