There is a need to use XACC's plugins in a thread-safe manner (multi-threading).
e.g., https://github.com/eclipse/xacc/pull/455/files
Using mutex to guard member functions may not be sufficient since service implementations may have internal states (e.g., set by initialize()).
Hence, to enable safe multi-threading of XACC, we should make all services cloneable, i.e., the service registry returns independent instances of the plugin when requested.
For example, one potential systematic way to do this is to make Identifiable (all services are derived from this) also cloneable.
There is a need to use XACC's plugins in a thread-safe manner (multi-threading).
e.g., https://github.com/eclipse/xacc/pull/455/files
Using
mutexto guard member functions may not be sufficient since service implementations may have internal states (e.g., set byinitialize()).Hence, to enable safe multi-threading of XACC, we should make all services cloneable, i.e., the service registry returns independent instances of the plugin when requested.
For example, one potential systematic way to do this is to make
Identifiable(all services are derived from this) also cloneable.