dwave-hybrid icon indicating copy to clipboard operation
dwave-hybrid copied to clipboard

Should we allow a single Runnable instance to run multiple times concurrently?

Open randomir opened this issue 5 years ago • 0 comments

Since Runnable.run() is (via dispatch()) offloading next() to an executor, it's possible to run a single instance's next multiple times in parallel.

This is not a problem if next() does not mutate the self, but it could potentially lead to a state lost, or even a deadlock if it does.

Should be categorically ban such a behaviour, or leave the responsibility to the block/workflow developer?

randomir avatar Mar 19 '19 00:03 randomir