분류 전체보기 834

Thread deatch

int pthread_detach(pthread_t th); detach 는 "떼어내다" 라는 뜻을 가지며 main 쓰레드에서 pthread_create 를 이용해 생성된 쓰레드를 분리시킨다. 이 함수는 식별번호th인 쓰레드를 detach 시키는데, detach 되었을경우 해당(detach 된) 쓰레드가 종료될경우 pthread_joinc 을 호출하지 않더라도 즉시 모든 자원이 해제(free) 된다. 여기에서는 pthread_create 호출후 detach 하는 방법을 설명하고 있는데, pthread_create 호출시에 쓰레드가 detach 되도록 할수도 있다. [pthread_detach.c] #include #include #include #include // 쓰레드 함수 // 1초를 기다린후 아규..

OS/Linux 2010.05.12

Kernel thread test[정말 간단한]

Thread의 개념도 완전하지 않은 상태에서 Linux kernel Thread를 만든 내용 정말 초 간단.. 한 소스 1초마다 2개의 thread에서 값을 출력하는 사항. pthread_create 와 pthread_join 함수 사용 cpp를 컴파일 하기 위해서 g++를 사용했다. 그냥 gcc로 컴파일 하면, pthread 관련한 함수 들이 undefined로 출력된다. [pthread_create.cpp] #include #include #include #include // 쓰레드 함수 void *t_function(void *data) { int id; int i = 0; id = *((int *)data); while(1) { printf("%d : %d\n", id, i); i++; sleep..

OS/Linux 2010.05.12

Linux kernel Threads

Purpose Linux Device Driver 개발하면서, Kernel Thread를 creat 하고 stop 하는 방법을 test 해보기 위함. 해외 사이트의 오픈 소스를 참조(거의 copy하여 Test 함) 한 것으로, 자세한 테클은 정중히 거절합니다..ㅠㅠ (허접의 슬픔..흑흑) (Ref. : http://www.scs.ch/~frey/linux/kernelthreads.html ) The driver is implemented as a loadable module. In the init_module() routine five kernel threads are created. This kernel threads sleep one second, wake up, print a message and ..

OS/Linux 2010.05.12

Linux Deive Driver ..3rd

Linux Device Driver 공부하면 접하게 된 책.. 원서를 시판하면서,, PDF를 같이 공유해주고 있다. 좋아~ ㅋㅋ 근데 어렵다~~ ㅠㅠ see larger cover Open Book Content Title Pages License/Copyright Table of Contents About the Author/Colophon Preface Chapter 1: An Introduction to Device Drivers Chapter 2: Building and Running Modules Chapter 3: Char Drivers Chapter 4: Debugging Techniques Chapter 5: Concurrency and Race Conditions Chapter 6: Ad..

OS/Linux 2010.04.28

Linux 백신 f-prot ..

리눅스 해본다고.. 집에 우분투를 설치했다. 그런데... 뭔가 왠지 찜찜 하다. 윈도우 깔면 항상 설치하던 백신.. 그넘이 없다.. 그래서 써핑하다.. 리눅스용 백신을 찾았다 ^^ 앗싸~~ 공짜~ ㅋ 주소는.. http://www.f-prot.com/index.html 여기고... 어차피 리눅스에서 다운받을꺼니까. .바로 다운로드 화면으로 고고 # wget http://files.f-prot.com/files/unix-trial/fp-Linux-i686-ws.tar.gz Resolving files.f-prot.com... 66.232.150.62, 84.40.30.92 Connecting to files.f-prot.com|66.232.150.62|:80... connected. HTTP request..

OS/Linux 2010.04.26