libabigail/include
Matthias Maennich 91a4274c9c abg-workers: Rework the worker queue to improve concurrent behaviour
This patch refactors the abigail::workers::queue and
abigail::workers::worker implementations to avoid holding locking
primitives longer than necessary.

In particular, the queue_cond_mutex was held during the entiry worker
runtime, effectively serializing the workers. Hence, use a mutex+cond
pair for each, the input and output queue and only synchronize around
the interaction with their corresponding queues. The
tasks_todo_(mutex|cond) are meant to synchronize scheduling and
distribution of work among workers, while tasks_done_(mutex|cond) are
used for synchronizing threads when putting back the tasks to the output
queue and to hold back threads waiting for the queue and workers to
drain.

Along that way, I did some cleanup that was now possible.
 - Move entire implementation of abigail::workers::task into header.
 - Make default_notify a static member.
 - Replace the multiple constructors with one with default arguments.

	* include/abg-workers.h (workers::task): move entire
	implementation to header and drop superfluous forward declaration.
	* src/abg-workers.cc (workers::task):: Likewise.
	(workers::queue::priv): Drop queue_cond_mutex, rename queue_cond
	to tasks_todo_cond, add task_done_cond, make default_notify
	static.
	(workers::queue::priv::priv): Add default arguments to fully
	qualified constructor, drop the remaining ones.
	(workers::queue:prive::more_tasks_to_execute): Drop method.
	(workers::queue:prive::schedule_task): Do not synchronize access
	to the queue condition variable, but only on the mutex.
	(do_bring_workers_down): Likewise. Also await tasks_done to be
	empty.
	(workers::queue:prive::worker::wait_to_execute_a_task): Await
	tasks on the tasks_todo with tasks_todo_(cond|mutex) and signal
	task completion to tasks_done_cond.

Signed-off-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2020-02-19 13:23:18 +01:00
..
abg-comp-filter.h Bug 25128 - Handle decl-only classes that differ only in size 2019-11-08 11:09:13 +01:00
abg-comparison.h Bug 24690 - Support comparing non-reachable types of a binary 2020-01-06 14:26:00 +01:00
abg-config.h Add (undocumented) support for version suffixes 2020-01-09 17:06:31 +00:00
abg-corpus.h Bug 24690 - Support comparing non-reachable types of a binary 2020-01-06 14:26:00 +01:00
abg-cxx-compat.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-diff-utils.h Bug 24690 - Support comparing non-reachable types of a binary 2020-01-06 14:26:00 +01:00
abg-dwarf-reader.h Fix / add include guards 2020-01-27 07:39:51 +00:00
abg-fwd.h abg-fwd: drop duplicate forward declaration for corpus_sptr 2020-01-27 07:39:54 +00:00
abg-hash.h Update copyright for 2019 2019-01-07 14:54:47 +01:00
abg-ini.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-interned-str.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-ir.h Bug 24690 - Support comparing non-reachable types of a binary 2020-01-06 14:26:00 +01:00
abg-libxml-utils.h Fix / add include guards 2020-01-27 07:39:51 +00:00
abg-libzip-utils.h Fix / add include guards 2020-01-27 07:39:51 +00:00
abg-reader.h Bug 24690 - Support comparing non-reachable types of a binary 2020-01-06 14:26:00 +01:00
abg-reporter.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-sptr-utils.h Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00
abg-suppression.h Support symbol_name_not_regexp in [suppress_{function, variable}] 2019-11-08 11:01:54 +01:00
abg-tools-utils.h KMI Whitelists: Drop old whitelist extraction methods 2020-01-21 18:38:00 +00:00
abg-traverse.h add missing virtual destructors 2019-04-16 16:11:01 +02:00
abg-version.h.in Add (undocumented) support for version suffixes 2020-01-09 17:06:31 +00:00
abg-viz-common.h Update copyright for 2019 2019-01-07 14:54:47 +01:00
abg-viz-dot.h viz-dot: remove unused members from dot 2019-04-16 16:11:01 +02:00
abg-viz-svg.h Update copyright for 2019 2019-01-07 14:54:47 +01:00
abg-workers.h abg-workers: Rework the worker queue to improve concurrent behaviour 2020-02-19 13:23:18 +01:00
abg-writer.h abg-writer: drop deprecated API 2019-05-22 14:33:45 +02:00
Makefile.am Add compatibility layer for C++11 mode 2019-07-09 18:05:28 +02:00