Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
battle_c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
During summer vacation, Gitlab will be restart frequently. Use it carefully.
Show more breadcrumbs
JieunYoon
battle_c
Commits
29408374
Commit
29408374
authored
Aug 18, 2020
by
JieunYoon
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md
parent
4d52fc3d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
08_14_mutex/README.md
+17
-6
17 additions, 6 deletions
08_14_mutex/README.md
with
17 additions
and
6 deletions
08_14_mutex/README.md
+
17
−
6
View file @
29408374
# Personal Project8 : Thread(2020.08.14)
## Multi-t
hread
##
1.
Multi-t
asking
### Multi-thread란
### 1.1 Multi-tasking이란
*
여러 개의 task가 동시에 실행되는 것
*
운영체제의 스케줄링에 의해 번갈아 가면서 수행한다.
*
빠른 속도로 조금씩 번갈아 가면서 task들을 처리하여 user가 느끼기에는 동시에 처리되는 것처럼 보인다.
*
Multi-tasking의 스케줄링 방식
1.
Multi-programming
2.
Time-sharing
3.
Real-time
## 2. Multi-thread
### 2.1 Multi-thread란
*
한 프로그램 내에서 둘 이상의 스레드를 동시에 실행하는 것
*
장점
*
프로세스 내의 메모리를 공유함
...
...
@@ -10,13 +21,13 @@
*
단점
*
공유 데이터에 대한 경쟁조건이 발생
### 스레드 제어 system call API
###
2.2
스레드 제어 system call API
*
int pthread_create(pthread_t
*thread, const pthread_attr_t *
attr, void
*(*
start)(void
*), void *
arg)
*
void pthread_exit(void
*
retval)
*
pthread_t pthread_self(void)
*
int pthread_equal(pthread_t t1, pthread_t t2)
### 스레드 동기화 제어 system call API
###
2.3
스레드 동기화 제어 system call API
*
pthread_mutex_init
*
mutex를 동적으로 초기화
*
성공하면 0 return, 에러가 발생하면 에러번호(양수) return
...
...
@@ -45,9 +56,9 @@
```
## 과제
##
3.
과제
### 3개의 LED를 제어하는 응용 메인 코드 작성하기
###
3.1
3개의 LED를 제어하는 응용 메인 코드 작성하기
*
실행 조건
*
빨간색 LED는 1초 간격으로 on/off
*
초록색 LED는 2초 간격으로 on/off
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment