taskpool: expose new "shared" task pool implementation
authorMathieu Duponchelle <mathieu@centricular.com>
Tue, 3 Nov 2020 01:43:26 +0000 (02:43 +0100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 5 Nov 2020 18:18:28 +0000 (18:18 +0000)
commitb6df564251d7950196288a22e60e3111599d5629
tree2f5782d8b2b3e5e21e77eff73d0495d48f1e884e
parentb508287add7d43b66437ce856098ff86965190bc
taskpool: expose new "shared" task pool implementation

While the default implementation will spawn a thread per new
pushed task, this new implementation instead spawns a maximum
number of threads, then queues new tasks on existing threads.

The thread that the new task will be queued on is picked in
a pretty naive fashion, by simply popping the first thread
from a queue and pushing it back to the tail, but this is
an implementation detail and can always be sophisticated
in the future if the need arises.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/692>
gst/gsttaskpool.c
gst/gsttaskpool.h
tests/check/gst/gsttask.c