]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Taskprocessor optimization; switch Stasis to use taskprocessors
authorDavid M. Lee <dlee@digium.com>
Mon, 30 Sep 2013 18:26:27 +0000 (18:26 +0000)
committerDavid M. Lee <dlee@digium.com>
Mon, 30 Sep 2013 18:26:27 +0000 (18:26 +0000)
commite88afe2022cf92500d77968c0bb1d5c4cbd76ade
tree10fe2e4945c6c16ef1ff9be418f4c1184afc57a6
parent52d73f05f4a6dfb9e17f2ac4ecee728b890bb964
Taskprocessor optimization; switch Stasis to use taskprocessors

This patch optimizes taskprocessor to use a semaphore for signaling,
which the OS can do a better job at managing contention and waiting
that we can with a mutex and condition.

The taskprocessor execution was also slightly optimized to reduce the
number of locks taken.

The only observable difference in the taskprocessor implementation is
that when the final reference to the taskprocessor goes away, it will
execute all tasks to completion instead of discarding the unexecuted
tasks.

For systems where unnamed semaphores are not supported, a really
simple semaphore implementation is provided. (Which gives identical
performance as the original taskprocessor implementation).

The way we ended up implementing Stasis caused the threadpool to be a
burden instead of a boost to performance. This was switched to just
use taskprocessors directly for subscriptions.

Review: https://reviewboard.asterisk.org/r/2881/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@400178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
configs/stasis.conf.sample [deleted file]
configure
configure.ac
include/asterisk/autoconfig.h.in
include/asterisk/sem.h [new file with mode: 0644]
include/asterisk/stasis.h
include/asterisk/taskprocessor.h
main/sem.c [new file with mode: 0644]
main/stasis.c
main/stasis_config.c [deleted file]
main/taskprocessor.c