开发者

Is RapidXml thread safe?

开发者 https://www.devze.com 2023-01-24 21:45 出处:网络
The documentation for RapidXml says Pool maintains RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. Until

The documentation for RapidXml says

Pool maintains RAPIDXML_STATIC_POOL_SIZE bytes of statically allocated memory. Until static memory is exhausted, no dynamic memory allocations are done. When static memory is exhausted, pool allocates additional blocks of memory of size RAPIDXML_DYNAMIC_POOL_SIZE each, by using global new[] and delete[] operators

I interpret this as: RapidXML uses a global memory pool. Are operations on the global memory pool thread safe? I.e. can I use several instances of RapidXML parser throughout my program without having to consider threading开发者_如何学C issues?


My interpretation was wrong. The "static memory pool" is an array that is placed on the stack. It is therefore not static as in C++ static array, but rather static as in "not dynamically allocated".

The conclusion: RapidXML does not share the memory pool between instances. The question is therefore invalid.

0

精彩评论

暂无评论...
验证码 换一张
取 消