#define _MULTI_THREADED // using kernel thread #include#include #include #include //pthread_cond_t cond = PTHREAD_COND_INITIALIZER; pthread_cond_t cond; pthread_mutex_t mutex; void *thread_f(void *param) { int ret; while(1){ ret = pthread_mutex_lock(&mutex); printf("Thread is Waiting.....\n"); ret = pthread_cond_wait(&cond, &mutex); printf("Thread is Running\n"); ret = pthread_mutex_unlock(&mutex); } } int main(int argc, char **argv) { pthread_cond_init(&cond, NULL);/// pthread_create를 호출하기 전에, cond과mutex를 초기화 해야 된다 pthread_mutex_init(&mutex, NULL); pthread_t pth; int ret; ret = pthread_create(&pth, NULL, thread_f, NULL); printf("pthread_create\n"); sleep(5); // pthread_cond_init(&cond, NULL); // pthread_mutex_init(&mutex, NULL); for(int i=0; i<5 0="" a="" ake="" cond="" exit="" i="" mutex="" n="" pre="" printf="" pthread_cond_destroy="" pthread_mutex_destroy="" ret="pthread_mutex_unlock(&mutex);" return="" sleep="" thread...="" up="" work="">5>
dstat Requirements:python Dstat is a versatile replacement for iostat, vmstat and ifstat http://linux.softpedia.com/get/System/Diagnostics/Dstat-1401.shtml - download the source file - tar -xvjf dstate-0.7.2.tar.bz2 - cd dstate-0.7.2 - sudo make install 사용법 dstat -cdngys --top-io-adv --top-bio-adv 창넓이가 크면 dstat -cdngys --top-io --top-bio dstat 기본옵션은 -cdngy 2. pktstat requirements: libpcap-devel, ncurses-devel pktstat man page 사용법:sudo pktstat -i eth0 -T -l 실행결과 interface: eth0 total: 43.9Mb (3s) cur: 12.3M (78%) min: 12.3M max: 15.8M avg: 14.5M bps bps % b desc 1.4k 0% 4.3k arp 591.8 0% 1.2k ip proto 88 55.101.66.3 <-> igrp-routers 91.3k 0% 91.3k tcp a100236:4478 <-> console:ssh 42.6k 0% 216.4k tcp a100390:mailprox <-> console:ssh 1.1k 0% ...
Comments