summaryrefslogtreecommitdiff
path: root/lib/frr_pthread.c
AgeCommit message (Collapse)Author
2017-06-29lib: more `show thread cpu`Quentin Young
Add support for naming pthreads. Also, note that we don't have any records yet if that's the case. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-05-15*: make consistent & update GPLv2 file headersDavid Lamparter
The FSF's address changed, and we had a mixture of comment styles for the GPL file header. (The style with * at the beginning won out with 580 to 141 in existing files.) Note: I've intentionally left intact other "variations" of the copyright header, e.g. whether it says "Zebra", "Quagga", "FRR", or nothing. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-04-28lib: add pthread managerQuentin Young
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>