-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Open
Labels
mod: primitivesRelated to the Primitives moduleRelated to the Primitives moduletype: feature requestNew feature or requestNew feature or request
Description
What should we add?
In primitive_job.py
:
def _submit(self):
if self._future is not None:
raise JobError("Primitive job has been submitted already.")
executor = ThreadPoolExecutor(max_workers=1) # pylint: disable=consider-using-with
self._future = executor.submit(self._function, *self._args, **self._kwargs)
executor.shutdown(wait=False)
Any backend that's using PrimitiveJob
is locked into using Python's threading, which can cause locks when interacting with other non-Python languages with their own thread schedulers. Python processes don't have this problem (because they avoid the GIL). This behaviour is currently blocking me when using a custom backend I've written. It'd be great if the PrimitiveJob
could obey the preference set in the QISKIT_PARALLEL
environment variable.
Metadata
Metadata
Assignees
Labels
mod: primitivesRelated to the Primitives moduleRelated to the Primitives moduletype: feature requestNew feature or requestNew feature or request