일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- Flutter
- jupyter
- 유니티
- docker
- 구조체
- 깃
- c언어
- C언어 포인터
- 도커
- C# delegate
- vim
- Houdini
- C++
- Algorithm
- gitlab
- HTML
- c#
- dart 언어
- git
- c# 윈폼
- github
- Data Structure
- 다트 언어
- Python
- jupyter lab
- c# winform
- c# 추상 클래스
- 플러터
- Unity
- 포인터
Archives
- Today
- Total
목록상호배제 (1)
nomad-programmer
[Programming/C] Mutex (상호배제, 상호배타)
뮤텍스는 공유 데이터를 보호하는 락이다. 여러 스레드가 한 변수를 동시에 갱신하면, 결과는 예측할 수 없는 상태가 된다. #include #include #include #include #include // 2백만개 int number = 2000000; void error(char *msg) { fprintf(stderr, "%s: %s", msg, strerror(errno)); exit(1); } void *decay_number(void *t) { for (int i = 0; i < 100000; i++) { number = number - 1; } return NULL; } int main(int argc, char *argv[]) { void *result; int ste; pthread_t ..
Programming/C
2020. 6. 21. 01:21