We just need one tevent_threaded_context per unique combintation of tevent event contexts and pthreadpool_tevent pools, not multiple copies for identical combinations of a tevent contexts and a pthreadpool_tevent pools.
With this commit we register tevent contexts in a list in the pthreadpool_tevent structure and will only have one tevent_threaded_context object per tevent context per pool.
With many pthreadpool_tevent_job_send reqs this pays off, I've seen a small decrease in cpu-ticks with valgrind callgrind and a modified local.messaging.ping-speed torture test. The test modification ensured messages we never directly send, but always submitted via pthreadpool_tevent_job_send.
Pair-Programmed-With: Jeremy Allison
3b16bfe483d pthreadpool: create a tevent_threaded_context per registered event context
lib/pthreadpool/pthreadpool_tevent.c | 184 +++++++++++++++++++++++++++++++----
1 file changed, 167 insertions(+), 17 deletions(-)