You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is the only way to share stuff between subprocesses is to use the Queue object? Can we use any other types? It seems a bit overkill to use a queue if you only have two string values for example...
The example I have and want is this:
Two processes
Both of which use an infinite loop and do some work
The infinite loop is tied to a synchronized boolean that can be changed from the main application
When the main application sets the bool to false, the processes gracefully quit (the infinite loop ends)
The other string values which are passed to the sub processes are absolute filepaths to the location of where they saved their work.
The main application can now obtain the two filepaths (they are synchronoized/passed to the processes)
Exception has occurred: RemoteError
---------------------------------------------------------------------------
Traceback (most recent call last):
File "c:\Users\pbssu\Desktop\LeagueTools\LeagueHelper\venv\lib\site-packages\multiprocess\managers.py", line 212, in handle_request
result = func(c, *args, **kwds)
File "c:\Users\pbssu\Desktop\LeagueTools\LeagueHelper\venv\lib\site-packages\multiprocess\managers.py", line 379, in create
obj = callable(*args, **kwds)
File "c:\Users\pbssu\Desktop\LeagueTools\LeagueHelper\venv\lib\site-packages\multiprocess\managers.py", line 1016, in Array
return array.array(typecode, sequence)
TypeError: cannot use a str to initialize an array with typecode 'c'
So, no, there are a number of different ways, the most common is Pool. I'm not sure what example you are referring to with Array, as the doc you refer to only has an interface specification on it and no examples. Here's a doc for multiprocessing that has a ton of information and examples on sharing objects between processes: https://docs.python.org/3/library/multiprocessing.html. If you replace multiprocessing with multiprocess, all of the examples apply.
Also, can you be more specific with regard to pylint? If you post some code/commands that I can run to reproduce what you are seeing, then I might be able to help you with that.
Activity
ughstudios commentedon Jul 31, 2022
https://github.com/uqfoundation/multiprocess/blob/master/py3.10/doc/sharedctypes.html
The example here:
Results in:
Could you update the example?
ughstudios commentedon Jul 31, 2022
PyLint also does not like this package
mmckerns commentedon Oct 21, 2022
So, no, there are a number of different ways, the most common is
Pool. I'm not sure what example you are referring to withArray, as the doc you refer to only has an interface specification on it and no examples. Here's a doc formultiprocessingthat has a ton of information and examples on sharing objects between processes: https://docs.python.org/3/library/multiprocessing.html. If you replacemultiprocessingwithmultiprocess, all of the examples apply.Also, can you be more specific with regard to
pylint? If you post some code/commands that I can run to reproduce what you are seeing, then I might be able to help you with that.