Skip to content

Improve FifoEvent, ActiveMethod, ActiveResult#4211

Merged
aleks-f merged 1 commit intopocoproject:develfrom
bas524:fifoevent
Nov 21, 2023
Merged

Improve FifoEvent, ActiveMethod, ActiveResult#4211
aleks-f merged 1 commit intopocoproject:develfrom
bas524:fifoevent

Conversation

@bas524
Copy link
Copy Markdown
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
@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