pyconcrete icon indicating copy to clipboard operation
pyconcrete copied to clipboard

pyconcrete and multiprocessing

Open deatinor opened this issue 6 years ago • 4 comments
trafficstars

Hello,

I am trying to use pyconcrete to encrypt a python code using multiprocessing. This is the code:

from math import sqrt
from joblib import Parallel, delayed
Parallel(n_jobs=2)(delayed(sqrt)(i ** 2) for i in range(10))

The compilation works fine, but at execution time the program crashes with the following message:

Exception ignored in: <module 'threading' from '/Users/stefanosavare/anaconda3/lib/python3.6/threading.py'>
Traceback (most recent call last):
  File "/Users/stefanosavare/anaconda3/lib/python3.6/threading.py", line 1289, in _shutdown
    assert tlock.locked()
SystemError: <built-in method locked of _thread.lock object at 0x1051e83c8> returned a result with an error set

Is there a way to fix it?

Thank you a lot!

deatinor avatar Jan 16 '19 14:01 deatinor

Hi,

It seems happened when the script use threading https://stackoverflow.com/questions/27844676/assertionerror-3-x-only-when-calling-py-finalize-with-threads

Because pyconcrete doesn't initialize threading in CPython, but joblib did Need sometime to investigate how to deal with it

Falldog avatar Jan 17 '19 16:01 Falldog

Hi!,

I had the same error using PyQt5 with some QtWidgets

Exception ignored in: <module 'threading' from '/usr/lib/python3.6/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 1289, in _shutdown
    assert tlock.locked()
SystemError: <built-in method locked of _thread.lock object at 0x7f0442904f58> returned a result with an error set

Had you something progress with this? it would be fantastic.

Thank you a lot!

NachoJuanDev avatar Jun 18 '19 02:06 NachoJuanDev

@Falldog

is this problem solved ?

MyraBaba avatar Jan 01 '20 16:01 MyraBaba

threading error should be same with #71

Falldog avatar Sep 26 '21 03:09 Falldog