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

Improve FifoEvent, ActiveMethod, ActiveResult #4211

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

bas524
Copy link
Contributor

@bas524 bas524 commented Oct 22, 2023

Current FifoEvent implementation uses Poco::ActiveResult for async execution.
It has constraint:

  • A number of FifoEvents (ActiveResults) depends on maxCapacity in the Poco::ThreadPool and eventually on max-thread-count in the OS if we'll try to increase threads count
  • Often FifoEvent (ActiveResult) requires new thread, it is very expensive

My pullrequest contains:

  • Separate implementation ActiveThreadPool for ActiveResults & FifoEvents, it uses a fixed number of threads and NotificationQueues in them for Runnable execution. ActiveThreadPool uses round-robin model for task distribution, where task is Runnable
  • Some optimizations for notification which replaces copy with move
  • Tests for ActiveThreadPool & new test for FifoEvent (testAsyncNotifyBenchmark)
  • Changes in project files for including new .cpp & .h and enabling parallel build for cmake projects

This changes allow send as many FifoEvents as you want and execute as many ActiveResults as you want

@aleks-f aleks-f added this to the Release 1.13.0 milestone Nov 21, 2023
@aleks-f aleks-f merged commit 4a9285c into pocoproject:devel Nov 21, 2023
14 of 15 checks passed
@bas524 bas524 deleted the fifoevent branch November 22, 2023 18:52
aleks-f pushed a commit that referenced this pull request Nov 23, 2023
Co-authored-by: Alexander B <bas524@ya.ru>
aleks-f pushed a commit that referenced this pull request Nov 27, 2023
Co-authored-by: Alexander B <bas524@ya.ru>
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.

2 participants