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

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);
     


Ïà¹ØÎĵµ£º

LinuxÖÐALIGNºêµÄÔ­Àí

1. Òý×Ó
int a;  
int size = 8;
   
Èç¹ûÈÃaΪ(size =8)µÄÕûÊý±¶±íʾ³É¶þ½øÖÆÓ¦ÊÇʲôÑù×ÓÄØ£¿ÄǾÍÊÇÈÃÕâ¸öÊý±íʾ³É¶þ½øÖÆÊ±µÄ×îºóÈýλΪ0.
¶øÒª´ïµ½ÕâһĿ±ê£¬Ö»ÒªÏÂÃæÕâ¸öÊýÓëËü½øÐÐÓëÔËËã¾Í¿ÉÒÔÁË:
  11111111 11111111 11111111 11111000  
¶øÉÏÃæÕâ¸öÊýʵ¼ÊϾÍÊ ......

ʹÓÃLinuxµÄrsyncÃüÁîʵÏÖ£º¶à·þÎñÆ÷¾µÏñͬ²½

¡¡¡¡ÊµÏÖ¹¦ÄÜ£ºµ±Óû§ÔÚ±¾µØ¿Í»§¶ËijĿ¼ÄÚ½¨Á¢¡¢Ð޸ġ¢É¾³ýĿ¼»òÎļþ¡¢ÐÞ¸ÄĿ¼»òÎļþµÄÊôÐÔ£¬Ö»ÒªÖ´ÐÐÏàͬµÄshell½Å±¾£¬rsync¾Í»á×Ô¶¯ÕÒ³öÓи͝»òɾ³ýµÄÊý¾Ý£¬½«Æä´«Ë͵½·þÎñÆ÷ÉÏ£¬Ê¹·þÎñÆ÷¶ËijĿ¼ÄÚµÄÊý¾Ý¸ú±¾µØ¿Í»§¶ËijĿ¼ÄÚµÄÊý¾Ý±£³ÖÒ»Ö¡£
¡¡¡¡¡ï·½Ê½Ò»£º
¡¡¡¡Ò»¡¢·þÎñÆ÷¶Ë£¨Àý£º10.0.0.1*£©£º
¡¡¡¡1¡¢´´½¨Óà ......

linux¶ÁдÎļþËٶȲâÊÔ

Ò». ÎļþÒ»´Î¶ÁÈëËÙ¶È
linux϶ÁÎļþÕâ¶«Î÷×îºó¶¼ÊÇҪͨ¹ýϵͳµ÷ÓÃsys_read(fd,buf,count)À´ÊµÏֵģ¬ËùÒÔÈç¹ûÒªÌá¸ßËÙ¶È£¬¾ÍÊÇ×î¼òµ¥µØµ÷ÓÃsys_readµÄ·â×°£¬±ÈÈçÖ±½ÓÓÃread()»òfread()¡£ÏÂÃæÊÇÎÒÔÚlinuxÏµļ¸¸ö²âÊÔ¡£
Ê×ÏÈ´´½¨Ò»¸ö130MÊý¾ÝÎļþ dd if=/dev/zero of=data bs=1024k count=130
[dd if=/dev/zero of=data b ......

ÔÚwindowsÏÂͨ¹ýVC6.0µÚÒ»´ÎÓÃCµ÷ÓÃSQLite

1. ÏÂÔØSQLitewindows°æ
ÎÒÃÇ¿ÉÒÔ´ÓÏÂÁÐÍøÕ¾ÏÂÔØsqliteµÄwindows°æ¡£
http://www.sqlite.com.cn/bbs/topicdisp.asp?tid=182&topage=1#gotolast
ÏÂÔØÕâ¸öÈý¸öÎļþ£º
SQLite 3.3.7 ÏÂÔØ
windows°æ
sqlite-3_3_7.zip      Õâ¸öÊÇSQLiteµÄwindows¿ÉÖ´ÐÐÎļþ
sqlitedll-3_3_7.zip Õâ¸ö ......

[C]CÓïÑÔ»ù´¡¹®¹ÌרÌâ Á´±íÖ®£¨Á´±í·´×ª£©

 Á´±íÊÇcÓïÑÔÖкÜÖØÒªµÄÊý¾Ý½á¹¹£¬ÊÇ¿¼²ìÒ»¸ö³ÌÐòÔ±µÄ»ù±¾¹¦µÄÊֶΣ¬Ö®Ç°ÔÚÒ»¼Ò¹«Ë¾ÃæÊÔʱ¾ÍÎʵ½ÁË
ʵÏÖÒ»¸öÁ´±íµÄ·´×ª£¬µ±Ê±¾ÍÊÇûÓкܺÃÀä¾²µÄ˼¿¼£¬½ñÌìÔÚÕâÀïд³öÀ´£¬¹²Ã㣡
 »ù±¾Ëã·¨£º
       1. ÅжÏÊÇ·ñΪ¿Õ£¬Èç¹ûΪ¿Õ£¬·µ»ØNULL
       ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ