Ask Your Question
3

After execution in python, why are the processes not shutting down in multiprocessing?

asked 2022-06-27 11:00:00 +0000

huitzilopochtli gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2021-10-04 01:00:00 +0000

devzero gravatar image

There can be several reasons why processes in Python's multiprocessing module are not shutting down:

  1. The processes may be blocked on I/O: If a process is waiting for I/O such as a network request or file I/O, it may not exit until the I/O has completed.

  2. Child processes may have their own child processes: If a child process creates its own child processes, the parent process may not know about them and won't be able to terminate them.

  3. Race conditions and synchronization issues: If there are race conditions or synchronization issues in the code, it may cause the processes to hang.

  4. Stuck resources: If a resource such as a lock or semaphore is stuck or not released properly, it may cause the processes to hang.

  5. Unhandled exceptions: If an unhandled exception occurs in a child process, it may cause the process to hang.

To resolve these issues, it is necessary to carefully review the code and ensure that all resources are properly released and that all child processes are properly managed. Additionally, it may be necessary to add timeouts or other mechanisms to prevent processes from hanging indefinitely.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-06-27 11:00:00 +0000

Seen: 8 times

Last updated: Oct 04 '21