mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-07 21:23:32 +00:00
![]() We have encountered that multi-threading usage that user creates, multiple canvases owned by multiple user threads. Current sw_engine memory pool has been considered only for multi-threads, spawned by tvg task scheduler. In this case it's safe but when user threads introduced, it can occur race-condition. Thus, Here is a renewal policy that non-threading tvg(initialized threads with zero), takes care of multiple user threads bu changing its policy, each of canvases should have individual memory pool to guarantee mutual-exclusion. @API additions enum MempoolPolicy { Default = 0, ///< Default behavior that ThorVG is designed to. Shareable, ///< Memory Pool is shared among the SwCanvases. Individual ///< Allocate designated memory pool that is only used by current instance. }; Result SwCanvas::mempool(MempoolPolicy policy) noexcept; All in all, if user calls multiple threads, set memory pool policy to Individual. |
||
---|---|---|
.. | ||
meson.build | ||
thorvg.h | ||
thorvg_capi.h |