Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
Tags
- autoencoder
- FDS
- docker
- 알고리즘
- datascience
- python
- NaverAItech
- Kaggle
- 백준
- rnn
- DeepLearning
- torchserve
- Kubernetes
- PytorchLightning
- GIT
- 프로그래머스
- pytorch
- Matplotlib
- 네이버AItech
- GitHub Action
- 완전탐색
- FastAPI
- 코딩테스트
- vscode
- github
- pep8
- NLP
- wandb
- GCP
- leetcode
Archives
- Today
- Total
목록producer-consumer problem (1)
Sangmun
python Producer-Consumer(생산자 소비자 문제) Threading
Producer-consumer Problem(생산자 소비자 문제는) threading이나 프로세스 동기화 이슈와 관련된 computer science에서 자주 볼 수 있는 문제이다. 현재 글에서는 python의 Lock을 이용하여 Producer-comsumer problem을 어떻게 해결하는지 다루고자 한다. 다음과 같은 예제가 있다. 외부로부터 message를 수신하는 작업과 수신한 message를 db에 저장하는 작업이 있다. 이때 외부에서 들어오는 message는 언제 들어올지 모르며 때때로 너무 많은 양이 들어올 때가 있다. 이 message를 수신하는 작업이 Producer이다. 수신한 message를 db에 저장하는 작업 Consumer이며 작업의 속도가 상대적으로 느리다. 따라서 외부에서..
개발
2023. 3. 7. 22:32