|
My Project
|
#include <stdlib.h>#include <stdio.h>#include <string.h>#include <errno.h>#include <unistd.h>#include <sys/wait.h>#include <pthread.h>#include <semaphore.h>#include <sys/socket.h>#include <fcntl.h>#include "kernel_chat.h"#include "kernel_engine.h"#include "kernel_print.h"#include "kernel_smartptr.h"Go to the source code of this file.
Macros | |
| #define | NUM_THREADS 3 |
| #define | NUM_PROCESSES 2 |
| #define | DEFAULT_TCP_PORT 5100 |
Functions | |
| void | run_multithreading (int num_threads, int use_semaphore,...) |
| 멀티스레드 실행 함수 (쓰레드 수 및 동기화 방법을 입력받음) | |
| void * | semaphore_thread (void *arg) |
| 세마포어를 사용하는 스레드 작업 함수 | |
| void * | mutex_thread (void *arg) |
| 뮤텍스를 사용하는 스레드 작업 함수 | |
| void * | thread_function (void *arg) |
| int | main (int argc __attribute__((unused)), char **argv __attribute__((unused))) |
| #define DEFAULT_TCP_PORT 5100 |
Definition at line 31 of file td_kernel_engine.c.
| #define NUM_PROCESSES 2 |
Definition at line 30 of file td_kernel_engine.c.
| #define NUM_THREADS 3 |
Definition at line 29 of file td_kernel_engine.c.
| int main | ( | int argc | __attribute__(unused), |
| char **argv | __attribute__(unused) ) |
Definition at line 57 of file td_kernel_engine.c.
| void * mutex_thread | ( | void * | arg | ) |
뮤텍스를 사용하는 스레드 작업 함수
뮤텍스를 사용하는 스레드 작업 함수 선언
| arg | 뮤텍스 포인터 |
Definition at line 427 of file kernel_engine.c.
| void run_multithreading | ( | int | num_threads, |
| int | use_semaphore, | ||
| ... ) |
멀티스레드 실행 함수 (쓰레드 수 및 동기화 방법을 입력받음)
멀티스레드 실행 함수 선언 (쓰레드 수 및 동기화 방법을 입력받음)
| num_threads | 생성할 스레드 수 |
| use_semaphore | 세마포어 사용 여부 |
| ... | 동기화 방법 (세마포어 또는 뮤텍스) |
Definition at line 453 of file kernel_engine.c.
| void * semaphore_thread | ( | void * | arg | ) |
세마포어를 사용하는 스레드 작업 함수
세마포어를 사용하는 스레드 작업 함수 선언
| arg | 세마포어 포인터 |
Definition at line 402 of file kernel_engine.c.
| void * thread_function | ( | void * | arg | ) |