mirror of
https://github.com/boostorg/regex.git
synced 2025-07-29 03:57:27 +02:00
Made the mem_cache_block lockfree
This *significantly* improves parallel performance of regex. Currently if I have a large number of threads all using regexes; even if they are using idependent regex objects, performance is still extremely poor due to the lock inside of the mem_block_cache.
This commit is contained in:
@ -192,9 +192,9 @@ BOOST_REGEX_DECL void BOOST_REGEX_CALL put_mem_block(void* p)
|
||||
#else
|
||||
|
||||
#ifdef BOOST_HAS_THREADS
|
||||
mem_block_cache block_cache = { 0, 0, BOOST_STATIC_MUTEX_INIT, };
|
||||
mem_block_cache block_cache;
|
||||
#else
|
||||
mem_block_cache block_cache = { 0, 0, };
|
||||
mem_block_cache block_cache;
|
||||
#endif
|
||||
|
||||
BOOST_REGEX_DECL void* BOOST_REGEX_CALL get_mem_block()
|
||||
|
Reference in New Issue
Block a user