-
- Downloads
Add threadpool support to Asterisk.
This commit consists of two parts. Part one changes the taskprocessor API to be less self-contained. Instead, the taskprocessor is now more of a task queue that informs a listener of changes to the queue. The listener then has the responsibility of executing the tasks as it pleases. There is a default listener implementation that functions the same way as "classic" taskprocessors, in that it creates a single thread for tasks to execute in. Old users of taskprocessors have not been altered and still function the same way. Part two introduces the threadpool API. A threadpool is a special type of taskprocessor listener that has multiple threads associated with it. The threadpool also has an optional listener that can adjust the threadpool as conditions change. In addition the threadpool has a set of options that can allow for the threadpool to grow and shrink on its own as tasks are added and executed. Both set of changes contain accompanying unit tests. (closes issue ASTERISK-20691) Reported By: Matt Jordan Review: https://reviewboard.asterisk.org/r/2242 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@379432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
No related branches found
No related tags found
Showing
- include/asterisk/taskprocessor.h 130 additions, 19 deletionsinclude/asterisk/taskprocessor.h
- include/asterisk/threadpool.h 180 additions, 0 deletionsinclude/asterisk/threadpool.h
- main/taskprocessor.c 297 additions, 127 deletionsmain/taskprocessor.c
- main/threadpool.c 1105 additions, 0 deletionsmain/threadpool.c
- tests/test_taskprocessor.c 469 additions, 0 deletionstests/test_taskprocessor.c
- tests/test_threadpool.c 1430 additions, 0 deletionstests/test_threadpool.c
Loading
Please register or sign in to comment