MoonNote

반응형

Why does this VI have a race condition?

1. The lack of a Wait function will cause the While Loop to execute too quickly for data to be written correctly.

2. The local variables could be written to from another VI.

3. This VI does not have a race condition.

4. There is nothing to control the execution order of the two local variables.


정답 보기는 아래 더보기 클릭

 

 

더보기

정답 : 4. There is nothing to control the execution order of the two local variables.

VI가 실행될 때 경합 조건(Race Condition)이 발생하는 이유를 물어보는 문제이다. 경합 조건이란 두 객체 간 따로 의존성이 없다라는 의미로 와이어링 기반의 LabVIEW에서는 와이어의 흐름에 따라 실행 순서가 결정되는데, 따로 와이어링이 되어있지 않다면 어떤 변수 또는 노드가 실행될지 알 수 없다. 위의 코드에서 시퀀스 구조 및 와이어링으로 실행 순서를 지정해주었지만 'Numeric Indicator' 변수의 읽기와 쓰기 간 따로 와이어링이 되어있지 않기 때문에 2번째 시퀀스 프레임에서 실행될 때마다 다음 2가지 경우 중 하나가 실행된다고 생각할 수 있다.
1 : 변수 쓰기 먼저 실행 후 읽기
2 : 변수 읽기 먼저 실행 후 쓰기

따라서, 경합 조건(Race Condition)에 대한 정답으로 4. There is nothing to control the execution order of the two local variables.가 정답이다.

 

 

 

 

 

 

 

 

 

 

※ 이 글이 도움이 되었다면 "👆🏻구독"과 "🤍공감" 버튼을 클릭해주세요. 클릭 한번이 글 쓰는데 큰 힘이 됩니다.

공유하기

facebook twitter kakaoTalk kakaostory naver band