Open Nic30 opened 4 years ago
Currently the Global Interpreter Lock is held even if only C++ code is parsing. Releasing GIL during this time will make multithreading as fast as multiprocessing without need for inter process communication.
https://github.com/Nic30/hdlConvertor/blob/2d3458d0881483a0be7ff9a2b9628398ff211ee6/hdlConvertor/_hdlConvertor.pyx#L42
To be replace by cdef cppclass Convertor nogil:
cdef cppclass Convertor nogil:
Should do the job. (Not tested)
It may not be so easy as the python AST object are build in c++, but we may just need to wrap this method in GIL.
Currently the Global Interpreter Lock is held even if only C++ code is parsing. Releasing GIL during this time will make multithreading as fast as multiprocessing without need for inter process communication.