MPMCQueue icon indicating copy to clipboard operation
MPMCQueue copied to clipboard

non-copyable of MPMCQueue

Open OHNOalan opened this issue 1 year ago • 1 comments

  // non-copyable and non-movable
  Queue(const Queue &) = delete;
  Queue &operator=(const Queue &) = delete;

Is there any reason why MPMC is non-copyable and non-movable~ And if I need to use it as a copyable data structure. What should I do~

OHNOalan avatar Jun 16 '24 19:06 OHNOalan

The queue is modified concurrently - in the case that it is modified during your copy, your copy will likely end up in a state that did not exist or that is invalid.

If you want a copyable queue it will surely need to be locking.

joadnacer avatar Jun 25 '24 11:06 joadnacer