Replies: 1 comment
-
공부하면 좋을 자료 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
질문
멀티 스레드 속성을 모르는 상태에서 실행해보면 결과를 보고 깜짝 놀란다고 했었는데 어느 부분에서 놀라야하는지 잘 모르겠다.
답변
https://covenant.tistory.com/236
![image](https://user-images.githubusercontent.com/25525648/120150159-ab647c80-c225-11eb-8d4a-748f7f675b80.png)
공유 자원(전역 변수)에 대해 동기화가 되기 전에 해당 자원을 참조함으로써 share 변수의 증가가 바라던 바로 되지 않는 것이 예상 결과와 다르므로 멀티 스레드에서 공유 자원을 사용하지 않는 것이 좋다고 하는 것이다.
Beta Was this translation helpful? Give feedback.
All reactions