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µ ......
1¡£»ù´¡ÖªÊ¶
linuxÌṩ·þÎñÊÇÓÉÔËÐÐÔÚºǫ́µÄÊØ»¤³ÌÐò£¨daemon£©À´Ö´Ðеġ£
ÊØ» ......
Ò»£®Ç°ÑÔ
¡¡¡¡LinuxÓµÓзḻ¸÷ÖÖÔ´´úÂë×ÊÔ´,µ«ÊǴ󲿷ִúÂëÔÚWindowsƽ̨Çé¿öÊÇÎÞ·¨Õý³£±àÒëµÄ¡£Windowsƽ̨¸ù±¾ÎÞ·¨Ö±½ÓÀûÓÃÕâЩԴ´úÂë×ÊÔ´¡£Èç¹ûÏëҪʹÓÃÍêÕûµÄ´úÂ룬¾ÍÒª×öÒÆÖ²¹¤×÷¡£ÒòΪC/C++ LibraryµÄ²»Í¬ºÍÆäËûµÄһЩÔÒò£¬ÒÆÖ²C/C++´úÂëÊÇÒ»ÏîÀ§ÄѵŤ×÷¡£±¾ÎĽ«ÒÔÒ»¸öʵ¼ÊµÄÀý×Ó£¨Tar£©À´ËµÃ÷ÈçºÎ°ÑLinux´úÂëÒÆÖ² ......
Linux initial RAM disk (initrd) overview
Learn about its anatomy, creation, and use in the Linux boot process
M. Tim Jones
(mtj@mtjones.com
), Consultant Engineer, Emulex
M. Tim Jones is an embedded software architect and the author of GNU/Linux Application Programming
, AI Application Prog ......
[ת]linuxÆô¶¯Ê±¹ÒÔØrootfsµÄ¼¸ÖÖ·½Ê½
Ò»Ö±¶ÔlinuxÆô¶¯Ê±¹ÒÔØ¸ùÎļþϵͳµÄ¹ý³Ì´æÔÚןܶàÒÉÎÊ£¬½ñÌìÔÚˮľ¾«»ªÇøÕÒµ½ÁËÓÐÓõÄ×ÊÁÏ£¬ÕªÂ¼ÈçÏ£º
1¡£linuxÆô¶¯Ê±£¬¾¹ýһϵÁгõʼ»¯Ö®ºó£¬ÐèÒªmount ¸ùÎļþϵͳ£¬Îª×îºóÔËÐÐinit½ø³ÌµÈ×ö×¼±¸£¬mount
¸ùÎļþϵͳÓÐÕâô¼¸ÖÖ·½Ê½£º
1£©ÎļþϵͳÒѾ´æÔÚÓÚÓ²ÅÌ£¨»òÕßÀàËÆµÄÉ豸 ......