python:parallel_processing
차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판이전 판다음 판 | 이전 판 | ||
| python:parallel_processing [2017/09/06 22:52] – rex8312 | python:parallel_processing [2024/03/23 02:42] (현재) – 바깥 편집 127.0.0.1 | ||
|---|---|---|---|
| 줄 3: | 줄 3: | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| + | |||
| + | AWS lambda | ||
| + | * http:// | ||
| + | |||
| + | ====== Multiprocessing ====== | ||
| + | |||
| + | 자식 프로세스 다 죽이기 | ||
| + | |||
| + | <code python> | ||
| + | def killtree(pid, | ||
| + | parent = psutil.Process(pid) | ||
| + | for child in parent.children(recursive=True): | ||
| + | print " | ||
| + | child.kill() | ||
| + | |||
| + | if including_parent: | ||
| + | parent.kill() | ||
| + | |||
| + | ## get the pid of this program | ||
| + | pid=os.getpid() | ||
| + | |||
| + | ## when you want to kill everything, including this program | ||
| + | killtree(pid) | ||
| + | </ | ||
| + | |||
| + | * https:// | ||
python/parallel_processing.1504738325.txt.gz · 마지막으로 수정됨: (바깥 편집)