Review Board 1.7.16

Add a serializer interface to the threadpool

Review Request #2323 - Created Feb. 8, 2013 and submitted

David Lee
This patch adds the ability to create a serializer from a thread pool. A
serializer is a ast_taskprocessor with the same contract as a default
taskprocessor (tasks execute serially) except instead of executing out
of a dedicated thread, execution occurs in a thread from a
ast_threadpool. Think of it as a lightweight thread.

While it guarantees that each task will complete before executing the
next, there is no guarantee as to which thread from the pool individual
tasks will execute. This normally only matters if your code relys on
thread specific information, such as thread locals.

This patch also fixes a bug in how the 'was_empty' parameter is computed
for the push callback.
Unit testing.
Review request changed
Updated (Feb. 11, 2013, 8:22 a.m.)
Forgot this bit with the last patch.
* Serializer now properly increments/decrements the refcount on the threadpool.
Ship it!
Posted (Feb. 11, 2013, 9:22 a.m.)
Aside from the discrepancy in the serializer_dupe test, this looks good to go.
/trunk/tests/test_threadpool.c (Diff revision 3)
Your new change results in two different threadpool serializer names. This test should have failed.
  1. And it does fail. Fixed. runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to