New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Made the mem_cache_block lockfree #23

Merged
merged 4 commits into from Jan 10, 2016

Conversation

Projects
None yet
2 participants
@ylow
Contributor

ylow commented Dec 9, 2015

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.

Yucheng Low
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.
@jzmaddock

This comment has been minimized.

Show comment
Hide comment
@jzmaddock

jzmaddock Dec 9, 2015

Collaborator

This is a good idea, but the patch isn't completely portable just yet. For preference I would like a solution which:

  • Uses when BOOST_NO_CXX11_HDR_ATOMIC is not set. The code will then need to check ATOMIC_POINTER_LOCK_FREE == 2 before using atomic pointers, otherwise:
  • Uses Boost.Atomic, but checks BOOST_ATOMIC_POINTER_LOCK_FREE==2 before attempting to use atomics. Otherwise:
  • Falls back to the original implementation.
Collaborator

jzmaddock commented Dec 9, 2015

This is a good idea, but the patch isn't completely portable just yet. For preference I would like a solution which:

  • Uses when BOOST_NO_CXX11_HDR_ATOMIC is not set. The code will then need to check ATOMIC_POINTER_LOCK_FREE == 2 before using atomic pointers, otherwise:
  • Uses Boost.Atomic, but checks BOOST_ATOMIC_POINTER_LOCK_FREE==2 before attempting to use atomics. Otherwise:
  • Falls back to the original implementation.
@ylow

This comment has been minimized.

Show comment
Hide comment
@ylow

ylow Dec 11, 2015

Contributor

sounds good. I will update the pull request.

Contributor

ylow commented Dec 11, 2015

sounds good. I will update the pull request.

@ylow

This comment has been minimized.

Show comment
Hide comment
@ylow

ylow Dec 15, 2015

Contributor

I have updated with the suggested checks.

Contributor

ylow commented Dec 15, 2015

I have updated with the suggested checks.

Show outdated Hide outdated src/regex.cpp
@ylow

This comment has been minimized.

Show comment
Hide comment
@ylow

ylow Dec 31, 2015

Contributor

Sorry for the delay. I have updated the pull request with the fixes.

Contributor

ylow commented Dec 31, 2015

Sorry for the delay. I have updated the pull request with the fixes.

@jzmaddock

This comment has been minimized.

Show comment
Hide comment
@jzmaddock

jzmaddock Jan 9, 2016

Collaborator

Sorry for the delay. I have updated the pull request with the fixes.

I'm also backlogged, will get to this shortly, John.

Collaborator

jzmaddock commented Jan 9, 2016

Sorry for the delay. I have updated the pull request with the fixes.

I'm also backlogged, will get to this shortly, John.

@jzmaddock jzmaddock merged commit d8af53e into boostorg:develop Jan 10, 2016

@jzmaddock

This comment has been minimized.

Show comment
Hide comment
@jzmaddock

jzmaddock Jan 10, 2016

Collaborator

Many thanks for this!

Collaborator

jzmaddock commented Jan 10, 2016

Many thanks for this!

@springmeyer springmeyer referenced this pull request Feb 29, 2016

Closed

Support boost 1.60 #3333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment