summaryrefslogtreecommitdiff
path: root/lib/command.h
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2017-04-16 03:14:36 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2017-04-28 22:43:42 +0000
commit98f14af8bf8340115049e0df4888b6acc8701ea5 (patch)
treeb12f797be46311913a96d93f03b23b5a99320926 /lib/command.h
parent2c70efaed19379be49457069fc033d322394e29d (diff)
lib: add pthread manager
Adds infrastructure for keeping track of pthreads. The general idea is to maintain a daemon-wide table of all pthreads, running or not. A pthread is associated with its own thread master that can be used with existing thread.c code, which provides user-space timers, an event loop, non-blocking I/O callbacks and other facilities. Each frr_pthread has a unique identifier that can be used to fetch it from the table. This is to allow naming threads using a macro, for example: #define WRITE_THREAD 0 #define READ_THREAD 1 #define WORK_THREAD 2 The idea here is to be relatively flexible with regard to how daemons manage their collection of pthreads; the implementation could get away with just some #define'd constants, or keep a dynamically allocated data structure that provides organization, searching, prioritizing, etc. Overall this interface should provide a way to maintain the familiar thread.c userspace threading model while progressively introducing pthreads. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'lib/command.h')
0 files changed, 0 insertions, 0 deletions