How do you use multiprocessing with this?
See original GitHub issueOS: Windows 10 64 bit. Python 3.6.6 v3.6.6:4cf1f54eb7 64 bit Nuitka: First tried stable then tried the development Nuitka 0.5.33rc5 Python3.6 64 bit MSI I installed it with that. Short example:
import multiprocessing
import time
class Test(object):
def __init__(self):
self.process = multiprocessing.Process(target=self.run, args=())
self.process.daemon = True
def start(self):
self.process.start()
def stop(self):
self.process.terminate()
def run(self):
while True:
print('Never happening')
time.sleep(1.5)
Test().start()
The error changes based on what the process is doing. Example:
Traceback (most recent call last):
File "test.py", line 28, in <module __parents_main__>
File "test.py", line 15, in start
File "multiprocessing\process.py", line 105, in start
File "multiprocessing\context.py", line 223, in _Popen
File "multiprocessing\context.py", line 322, in _Popen
File "multiprocessing\popen_spawn_win32.py", line 65, in __init__
File "multiprocessing\reduction.py", line 60, in dump
TypeError: Can't pickle instancemethod objects
My program (closed source):
Traceback (most recent call last):
File "app.py", line 233, in <module __parents_main__>
File "multiprocessing\spawn.py", line 74, in freeze_support
File "multiprocessing\spawn.py", line 99, in spawn_main
File "multiprocessing\reduction.py", line 82, in steal_handle
OSError: [WinError 87] The parameter is incorrect
Whats the correct way to build a standalone with multiprocessing?
I used this (and many other combinations before that)
nuitka test.py --standalone --recurse-all --python-flag=no_site --plugin-enable=multiprocessing --recurse-plugin=multiprocessing --show-modules
Awesome work!
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (8 by maintainers)
Top Results From Across the Web
multiprocessing — Process-based parallelism — Python 3.11 ...
multiprocessing is a package that supports spawning processes using an API similar to the threading module. The multiprocessing package offers both local ...
Read more >Python Multiprocessing Example - DigitalOcean
Python multiprocessing Pool can be used for parallel execution of a function across multiple input values, distributing the input data across ...
Read more >Multiprocessing in Python - MachineLearningMastery.com
Multiprocessing is the ability of a system to run multiple processors at one time. If you had a computer with a single processor,...
Read more >Multiprocessing in Python | Set 1 (Introduction) - GeeksforGeeks
To import the multiprocessing module, we do: import multiprocessing · To create a process, we create an object of Process class. · To...
Read more >A beginners guide to Multi-Processing in Python
Multi-Processing in Python using Process class- ... Now let us get our hands on the multiprocessing library in Python. ... The above code...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Released as part of 0.5.32.7
Check this out: http://nuitka.net/doc/factory.html