Linux C notes (BOOK UNIX)
Chapter 1: Thread
¢Ù thread functions
1. pthread_self();
2. thread existing
you can get the value of rval_ptr just by pthread_join(pthread_t tht, void ** rval_ptr)
cancel a thread as the thread exits with PTHREAD_CANCELED in pthread_exit, this function only send a signal but not wait until the thread really exits
We can give a function to a thread with which the thread can invoke it when it exits. This
pthread_clean_push
These two functions must be in pairs in your function routines but not in the main function. And one thing should be mentioned as : the routine should not be returned but
pthread_detach(pthread_t tid)
4. Thread synchronization of thread
¢Ú thread. synchronics
pthread_mutex_t variable
pthread_mutex_destroy()
ii. Lock
pthread_mutex_trylock() return instantly
pthread_unlock()
pthread_rwlook_t
pthread_rwlock_init
pthread_rwlock_destroy
ii. Lock
pthread_rwlock_wrlook
pthread_rwlock_unlock
pthread_rwlock_tryrdlock
pthread_rwlock_trywrlock
3. Cond
i. initiation
pthread_cond_init(&pcndt, attr);
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
1. Òý×Ó
int a;
int size = 8;
Èç¹ûÈÃaΪ(size =8)µÄÕûÊý±¶±íʾ³É¶þ½øÖÆÓ¦ÊÇʲôÑù×ÓÄØ£¿ÄǾÍÊÇÈÃÕâ¸öÊý±íʾ³É¶þ½øÖÆÊ±µÄ×îºóÈýλΪ0.
¶øÒª´ïµ½ÕâһĿ±ê£¬Ö»ÒªÏÂÃæÕâ¸öÊýÓëËü½øÐÐÓëÔËËã¾Í¿ÉÒÔÁË:
11111111 11111111 11111111 11111000
¶øÉÏÃæÕâ¸öÊýʵ¼ÊϾÍÊ ......
Emebedded System and Application(Linux)
Goal
--
ÕÆÎÕǶÈëʽϵͳ¿ª·¢µÄÁ÷³Ì£¬ÏµÍ³ÒÆÖ²µÄ·½·¨£¬±àдBootloader
(Be familiar with the process of ES Developing
, System Migration
amd Bootloader Programming
)
Requriem ......
Linux Òýµ¼¹ý³ÌÄÚÄ»
Òýµ¼ Linux® ϵͳµÄ¹ý³Ì°üÀ¨ºÜ¶à½×¶Î¡£²»¹ÜÄúÊÇÒýµ¼Ò»¸ö±ê×¼µÄ x86 ×ÀÃæÏµÍ³£¬»¹ÊÇÒýµ¼Ò»Ì¨Ç¶ÈëʽµÄ PowerPC® »úÆ÷£¬ºÜ¶àÁ÷³Ì¶¼¾ªÈ˵ØÏàËÆ¡£±¾ÎĽ«Ì½Ë÷ Linux µÄÒýµ¼¹ý³Ì£¬´Ó×î³õµÄÒýµ¼µ½Æô¶¯µÚÒ»¸öÓû§¿Õ¼äÓ¦ÓóÌÐò¡£ÔÚ±¾ÎĽéÉܵĹý³ÌÖУ¬Äú½«Ñ§Ï°µ½¸÷ÖÖÓëÒýµ¼ÓйصÄÖ÷Ì⣬ ......
1.¸ÅÂÛ
¡¡ÔËÐÐʱ¿âÊdzÌÐòÔÚÔËÐÐʱËùÐèÒªµÄ¿âÎļþ£¬Í¨³£ÔËÐÐʱ¿âÊÇÒÔLIB»òDLLÐÎʽÌṩµÄ¡£CÔËÐÐʱ¿âµ®ÉúÓÚ20ÊÀ¼Í70Äê´ú£¬µ±Ê±µÄ³ÌÐòÊÀ½ç»¹ºÜµ¥´¿£¬Ó¦ÓóÌÐò¶¼Êǵ¥Ï̵߳쬶àÈÎÎñ»ò¶àÏ̻߳úÖÆÔÚ´Ëʱ»¹ÊôÓÚйÛÄî¡£ËùÒÔÕâ¸öʱÆÚµÄCÔËÐÐʱ¿â¶¼Êǵ¥Ï̵߳ġ£
Ëæ×ŲÙ×÷ϵͳ¶àÏ̼߳¼ÊõµÄ·¢Õ¹£¬×î³õµÄCÔËÐÐʱ¿âÎÞ·¨Âú×ã³ÌÐòµÄÐèÇó£ ......