Skip to content
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

[ZEND-569] Remove boost threads from networking system #612

Merged
merged 8 commits into from
Oct 3, 2023

Conversation

a-petrini
Copy link
Contributor

@a-petrini a-petrini commented Sep 27, 2023

This PR removes all the instances of boost::thread from the networking subsystem, in favor of STL <thread> library.
One key difference between the libraries is that boost::threads are interruptible; this feature has been replicated by the newly introduced class CThreadInterrupt.
The PR also removes the boost::condition_variable as well, preferring the STL equivalent.
Finally, boost::thread_group has been removed as well, but it has not been replaced with anything equivalent.

@a-petrini a-petrini changed the title Ap/remove boost threads from net zend 569 [ZEND-569] Remove boost threads from networking system Sep 29, 2023
Copy link
Contributor

@drgora drgora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR. Great improvement with getting rid of all the Millisleeps around, and of unneeded boost threads!
Looks good to me!

Copy link
Contributor

@JackPiri JackPiri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider addressing the two comments I left, they could make things a little bit simpler to read and maintain.
Thanks

@a-petrini a-petrini force-pushed the ap/remove_boost_threads_from_net_ZEND-569 branch 2 times, most recently from 587482a to da73f97 Compare October 2, 2023 13:03
Copy link
Contributor

@titusen titusen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "CThreadInterrupt" class could also throw an exception just like boost::interrupt does. It works better when interrupt is nested in function calls. Still if a thread was interrupted it can be achieved by if (interrupted) throw error but requires more syntax. So for our needs it's enough.

LGTM, thanks.

@a-petrini a-petrini force-pushed the ap/remove_boost_threads_from_net_ZEND-569 branch from da73f97 to e2591b7 Compare October 3, 2023 08:31
Copy link
Contributor

@JackPiri JackPiri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR is fine to.
Thanks

@ptagl ptagl merged commit 5d7b932 into main Oct 3, 2023
@ptagl ptagl deleted the ap/remove_boost_threads_from_net_ZEND-569 branch October 3, 2023 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants