Skip to content

13주차 [OS] Context switching#86

Open
leeejuhyeong wants to merge 11 commits intono-study-no-future:leeejuhyeongfrom
leeejuhyeong:context_switching
Open

13주차 [OS] Context switching#86
leeejuhyeong wants to merge 11 commits intono-study-no-future:leeejuhyeongfrom
leeejuhyeong:context_switching

Conversation

@leeejuhyeong
Copy link
Member

No description provided.

@leeejuhyeong leeejuhyeong changed the title 13주차 [OS] Context switching #85 13주차 [OS] Context switching Apr 10, 2022
@leeejuhyeong leeejuhyeong added the OS Operating System label Apr 10, 2022
@leeejuhyeong leeejuhyeong linked an issue Apr 10, 2022 that may be closed by this pull request
@leeejuhyeong
Copy link
Member Author

leeejuhyeong commented Apr 15, 2022

Thread는 많을수록 좋은가?

CPU 코어

  • CPU의 코어가 작업 수행
  • Thread가 많아도 코어 4개라면 동시에 수행되는 작업은 4개뿐

Thread가 많다면

  • 동기화 문제
  • 스택에 차지하는 메모리가 많아짐
  • PCB안에 TCB(Thread의 정보)가 많아져 Context Switching 시 비교할게 많아짐
  • 작업양이 많아서 대기 시간이 길어지고(병목현상), 교착상태가 발생할 확률이 높아짐

Thread의 개수는?

  • 위와 같은 문제점으로 효율적인 병렬 처리가 필요 -> Thread pooling(Thread 개수를 고정하고 가용한 Thread에 이벤트를 할당하는 방식)
  • 교착 상태 방지를 위해 적절한 동시성 제어(Lock)이 요구
  • CPU 개수와 동일하게 잡는 것이 일반적(?)

출처

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OS Operating System

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[OS] Context Switching

3 participants