-
Notifications
You must be signed in to change notification settings - Fork 4
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
Regex & multiprocessing #8
Comments
This isn't a problem in Dsfaker... Lambda cannot be pickled. But Xeger uses some lambdas, see: https://bitbucket.org/leapfrogdevelopment/rstr/src/a814f13cca0ebc2f5a82435760bd486d05551528/rstr/xeger.py?at=default&fileviewer=file-view-default#xeger.py-26 |
this version of the code based on xeger works well |
Nope it doesn't:
-> Here you are creating a list of strings, not a list of functions, its same as REGEX = ["a", "a", "a", "a"] But now let's try it the right way:
So we have the same error and no Dsfaker code is used... |
I've found a similar issue here: https://bugs.python.org/issue29517 |
using 3.5 didn't help. threadPool works. But I guess processPool is best for this use case. Then, maybe waiting for Xeger to improve his package (maybe an issue could help), I will distinguish in my package jobs that are process friendly and other. And run the later as single processes. |
Hi,
I encounter a problem with multi-process and sdgen Regex (while rstr.xeger works fine ):
in above example, main() does not work, while main2() works fine, and main3 too
http://pastebin.com/zmMrHaEQ
Maybe some insight here (about pickable concept):
http://stackoverflow.com/questions/8804830/python-multiprocessing-pickling-error
https://docs.python.org/3/library/pickle.html#what-can-be-pickled-and-unpickled
Thanks !
The text was updated successfully, but these errors were encountered: