반응형

임계 구역 문제(The Critical-Section Problem)

Consier a system consisteing of N threads { T1, T2, T3, ... }.
each thread has a segment of code in a process, called a

Critical Section(임계 구역)

in which the thread may be changing common variables, updating a table, writing a file, and so on.
 
When one thread is executing in its critical section, no other thread is to be allowed to execute in its critical section.
 

That is, no two threads are executing in their ciritical sections at the same time.

 

The critical-section problem is to design a protocol that the threads can use to cooperate.

 

https://www.geeksforgeeks.org/process-synchronization/amp/
  • Each thread must request permission to enter its critical section.
  • The section of code implementing this request is the entry section.
  • The critical section may be followed by an exit section.
  • The remaining code is the remainder section.

So, We need a solution called thread synchronization.
A solution to the critical-section problem must satisfy the following three requirements:

  1. Mutual Exclusion(상호 배제)
    : If thread T(i) is executing in its critical section, then no other threads can be executing in their critical sections.
  2. Progress(진행)
    : If no thread is executing in its critical section and some threads wish to enter their critical sections, then only those threads that are not executing in their remainder sections can participate in the decision on which will enter its critical section next, and this selection cannot be postponed indefinitely.
  3. Bounded wating(한계 대기)
    : There exists a bound, or limit, on the number of times that other threads are allowed to enter their critical sections after a thread has made a request to enter its critical section and before that request is granted.

 

'Development' 카테고리의 다른 글

[OS] 메모리 관리  (1) 2023.11.09
[OS] Types of Operating Systems  (0) 2023.10.20
[OS] 프로세스와 프로세스 관리  (0) 2023.10.18
[OS] 컴퓨터 시스템과 운영체제  (0) 2023.10.17
[OS] 운영체제의 시작과 발전  (1) 2023.10.16