原创 Linux多線程學習(八)pthread_setschedparam

 pthread_setschedparam 設置線程的權限 int pthread_setschedparam(pthread_t target_thread, int policy, const struct sched_param

原创 Linux多線程學習(十)pthread_atfork

pthread_atfork 註冊fork的函數 實例  #define _UNIX03_THREADS 1       2 #include <pthread.h>       3 #include <stdio.h>       4

原创 Linux多線程學習(一)pthread_create

Linux系統下的多線程遵循POSIX線程接口,稱爲pthread。 #include <pthread.h> int pthread_create(pthread_t *restrict tidp, const pthread_attr

原创 Linux多線程學習(七)sched_yield

sched_yield()這個函數可以使用另一個級別等於或高於當前線程的線程先運行。如果沒有符合條件的線程,那麼這個函數將會立刻返回然後繼續執行當前線程的程序。   在成功完成之後返回零,否則返回-1. 看下面一個實例 #define

原创 bsearch(二元搜索)

bsearch(二元搜索) 相關函數 qsort 表頭文件 #include<stdlib.h> 定義函數 void *bsearch(const void *key,const void *base,size_t nmemb

原创 前端代碼標準最佳實踐:HTML篇

http://powertoolsteam.blog.51cto.com/2369428/975187 Web前端代碼中,HTML是根本,CSS和JavaScript也是圍繞着既有的HTML結構來構建,所以良好的HTML代碼結構,除了

原创 前端代碼標準最佳實踐:javascript篇

http://powertoolsteam.blog.51cto.com/2369428/920652 前言 最近一直重構項目的前端代碼,也參考了各種前端代碼的最佳實踐,目的是讓前端的HTML,CSS,Javacript代碼更符合標

原创 lsearch(線性搜索)

lsearch(線性搜索) 相關函數 lfind 表頭文件 #include<stdlib.h> 定義函數 void *lsearch(const void * key ,const void * base ,size_t *

原创 Linux 0.11內核學習(二)

! ! SYS_SIZE is the number of clicks (16 bytes) to be loaded. ! 0x3000 is

原创 strtol(將字符串轉換成長整型數)

strtol(將字符串轉換成長整型數) 相關函數 atof,atoi,atol,strtod,strtoul 表頭文件 #include<stdlib.h> 定義函數 long int strtol(const char *n

原创 前端代碼標準最佳實踐:CSS

http://powertoolsteam.blog.51cto.com/2369428/958007 我們再來談談CSS代碼的一些標準實踐。 1,命名 和其他語言規範一樣,css的命名也講究命名要有意義,命名要儘可能短但是要足夠

原创 Linux多線程學習(五)pthread_equal

#define _MULTI_THREADED #include <pthread.h> #include <stdio.h> pthread_t theThread; static void checkResults(char

原创 Linux多線程學習(九)pthread_kill

int pthread_kill(thread_t tid, int sig) 將信號sig發送到由tid指定的線程,tid所指定的線程必須與調用線程在同一個進程中。如果sig爲零,將執行錯誤檢查,但並不實際發送信號。此錯誤檢查可用來檢查

原创 Linux多線程學習(四)pthread_self

原型: #include <pthread.h> pthread_t pthread_self(void); 說明:獲取本進程自身的 ID。進程 ID 類型是 pthread_t ,這個類型一般爲long long 型,8個字節。測

原创 Linux多線程學習(二)pthread_join

NAME pthread_join - wait for thread termination  等待直到線程終止 SYNOPSIS #include <pthread.h> int pthread_join(pthread_t