[vlc-devel] [RFC v2 0/2] New executor API

Romain Vimont rom1v at videolabs.io
Tue Sep 1 18:13:45 CEST 2020


The first RFC is here:
https://mailman.videolan.org/pipermail/vlc-devel/2020-August/136696.html

It generated a lot of design discussions (thank you all).

Here is a new proposal, attempting to take the review comments into account.

In this new version, the executor is "minimal":
 - it is not concerned by task interruption
 - it does not handle timeout
 - vlc_executor_Submit() returns void (at the cost of a "struct vlc_list node"
   field in the public struct vlc_runnable)
 - vlc_executor_Cancel() just dequeues a runnable not "started" yet

Note that vlc_executor_Cancel() now returns a boolean to indicate if the
runnable has been dequeued (it was not started yet) or not (it was started, so
it is running or execution is complete). This is necessary for the caller to
know if it must expect run() to be called (and typically decide to delete its
task or not).

Now, the preparser:
 - manages the list of the tasks it submitted to the executor
 - handles cancelation/interruption
 - handles timeout "manually" in its run() function

Thank you for your feedbacks ;)

Here is a branch: https://code.videolan.org/rom1v/vlc/commits/executor.rfc2

Romain Vimont (2):
  executor: introduce new executor API
  preparser: use the new executor API

 include/vlc_executor.h    | 149 ++++++++++++++
 src/Makefile.am           |   1 +
 src/libvlccore.sym        |   4 +
 src/misc/executor.c       | 263 +++++++++++++++++++++++++
 src/preparser/preparser.c | 399 ++++++++++++++++++++++++--------------
 5 files changed, 668 insertions(+), 148 deletions(-)
 create mode 100644 include/vlc_executor.h
 create mode 100644 src/misc/executor.c

-- 
2.28.0



More information about the vlc-devel mailing list