mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
99e14ab8a6
An issue that was identified for the thread safety of `ArrayHandle` is that if several threads are waiting to use an `ArrayHandle`, there might be an expectation of the order in which the operations happen. For example, if one thread is modifying the contents of an `ArrayHandle` and another is reading those results, we would need the first one to start before the second one. To solve this, a queue is added to `ArrayHandle` such that when waiting to read or write an `ArrayHandle` the `Token` has to be at the top of the queue in addition to other requirements being met. Additionally, an `Enqueue` method is added to add a `Token` to the queue without blocking. This allows a control thread to queue the access and then spawn a thread where the actual work will be done. As long as everything is enqueued on the main thread, the operations will happen in the expected order. |
||
---|---|---|
.. | ||
changelog | ||
build_stage.png | ||
CI-README.md | ||
CODEOWNERS | ||
CodingConventions.md | ||
external_stage.png | ||
ReleaseProcess.md |