Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.py #235

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update main.py #235

wants to merge 1 commit into from

Conversation

KmBase
Copy link
Contributor

@KmBase KmBase commented Jul 11, 2024

from multiprocessing import freeze_support is used to provide support for freezing the execution environment when using the multiprocessing module in a Python program that is to be packaged with pyinstaller on Windows systems.

without freeze_support, when a child process is spawned in Windows, it might re-import and re-execute the code that creates the child processes, leading to an endless creation of new processes. freeze_support ensures that this doesn't happen and the program runs smoothly with the expected number of processes.

from multiprocessing import freeze_support is used to provide support for freezing the execution environment when using the multiprocessing module in a Python program that is to be packaged with pyinstaller on Windows systems.

without freeze_support, when a child process is spawned in Windows, it might re-import and re-execute the code that creates the child processes, leading to an endless creation of new processes. freeze_support ensures that this doesn't happen and the program runs smoothly with the expected number of processes.
@s-simoncelli
Copy link
Contributor

Hi, thanks again for your contribution that is very much appreciated :)
To my knowledge you need to freeze the application only if the editor or any other imported module relies on the Python ‘multiprocessing’ module which is not used by the editor. Threads of new windows and when running pywr are spawned using the Qt bindings.

Have you encountered any issue without freezing the application?

Cheers,
Stefano

@KmBase
Copy link
Contributor Author

KmBase commented Jul 12, 2024

Have you encountered any issue without freezing the application?

it's works wel,but it might re-execute the code when freezing the application.
by the way,there is a crash ,when draing the buton in welcome page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants