Thread synchronization(스레드 동기화) 관련
213
작성한 질문수 27
안녕하세요 선생님. 동기화가 안되어서 Ending value가 2가 나오는 현상에 대해서 질문이 있습니다.
분명히 logging.info("Thread %s: finishing update", n)까지 실행이 3번되었는데 self.value가 3이 안나오는 이유가 궁금합니다.
수업에서 설명해주신거같은데 아직 이해가 잘 안된거같습니다. 동시에 함수가 실행되어서 나타나는 현상인가요?
답변 1
0
네 후반부에는 print문으로 출력해서 중간 결과를 확인하고 있습니다.
언급하신대로 출력이 되지 않을수도 있습니다.
If you are implementing asynchronous signal handlers using the signal module, you may not be able to use logging from within such handlers. This is because lock implementations in the threading module are not always re-entrant, and so cannot be invoked from such signal handlers.
또는 lock을 이용해서 출력도 가능합니다.
https://stackoverflow.com/questions/48745240/python-logging-in-multi-threads
Pros and Cons 관련하여 질문드립니다
0
57
1
daemon=True가 안 먹히네요
0
80
2
threadpoolexecutor.submit 실행 시 순차 실행
0
211
2
queue 를 사용하는 이유?
1
223
1
멀티프로세싱 관련 질문
0
176
1
python gil 삭제
0
369
1
4분:59초 질문 그룹쓰레드 (5). 대기중인 작업 -> Queue -> 완료 상태조사 -> 결과 또는 예외 -> 단일화(캡슐화) 에 관해서
0
165
1
데몬스레드 설명
0
235
1
작업영역 질문
0
302
1
cmd에서 code작성시 기존에 깔아둔 vscode에서 이상한 화면이 뜨네요
0
284
1
ThreadPoolExecutor에서 작업중인 쓰레드가 있을때 대기할수 있는 방법이 있는지요?
0
271
1
py_ad_2_5_2 Sharing State의 Argument 부분
0
296
1
Thread(4) 16:10 스레드 질문
0
334
1
파이썬 병렬처리 관련 질문이 있습니다.
0
345
1
10:10쯤에 질문있습니다.
0
249
1
multiprocessing(5) - Queue 공유 질문 in multiprocess
0
429
1
seleniumwire multiprocessing 에러
0
723
1
logging과 print 차이 질문입니다..!
0
655
1
확장프로그램 질문입니다
0
291
1
KeyboardInterrupt 시 p.join에서 exception 발생
0
410
1
경쟁상태,교착상태, 메모리영역
0
253
1
ProcessPoolExecutor 사용 시 pid 증가
0
349
1
multiprocess 환경에서 특정 Process에 문제가 있거나 죽었을때 처리 방법
0
746
1
ThreadPoolExecutor 에서 max_workers 질문입니다.
2
1517
1





