#include <worker_thread.h>
§ worker_thread_t()
| worker_thread_t::worker_thread_t |
( |
int |
inverval_ms = -1 | ) |
|
§ ~worker_thread_t()
| worker_thread_t::~worker_thread_t |
( |
| ) |
|
|
virtual |
§ do_work()
| virtual void worker_thread_t::do_work |
( |
| ) |
|
|
protectedpure virtual |
Actual working method to be implemented by derived classes.
Implemented in BackgroundRestorer< Coordinator, OnDoneCallback >, zero::buffer_pool::PageEvictioner, chkpt_m, ReaderThread, MergerDaemon, SkewShiftingThread, bf_tree_cleaner, restart_thread_t, RunRecycler, and page_cleaner_decoupled.
§ get_rounds_completed()
| long worker_thread_t::get_rounds_completed |
( |
| ) |
const |
|
inline |
§ is_busy()
| bool worker_thread_t::is_busy |
( |
| ) |
const |
|
inline |
§ notify_all()
| void worker_thread_t::notify_all |
( |
| ) |
|
|
protected |
§ notify_one()
| void worker_thread_t::notify_one |
( |
| ) |
|
|
protected |
These methods can be called from inside the do_work() implementation to wake up threads waiting at wait_for_notify().
§ quit()
| void worker_thread_t::quit |
( |
| ) |
|
|
protected |
§ run()
| void worker_thread_t::run |
( |
| ) |
|
|
privatevirtual |
§ should_exit()
| bool worker_thread_t::should_exit |
( |
| ) |
const |
|
inlineprotected |
Used to check inside work method if thread should exit without waiting for a complete do_work round
§ stop()
| void worker_thread_t::stop |
( |
| ) |
|
Request worker to stop on next do_work iteration and wait.
§ wait_for_round()
| void worker_thread_t::wait_for_round |
( |
long |
round = 0 | ) |
|
Wait until the round number given has been completed. If round <= rounds_completed, just wait for a notify instead of whole rounds.
§ wakeup()
| void worker_thread_t::wakeup |
( |
bool |
wait = false, |
|
|
int |
rounds_to_wait = -1 |
|
) |
| |
Wakes up the worker thread. If wait = true, the call will block until the worker has sent a notification on done_condvar AND the given number of rounds has passed. If rounds_to_wait == -1, then we only wait for a notify. If rounds_to_wait == 0, then we wait for the current round to finish if the worker is busy; if the worker is not busy, then it behaves just like the "-1" case. If rounds_to_wait > 0, then we wait for at least one full round (which means we actually wait for at least two round increments if the worker is busy)
§ cond_mutex
| std::mutex worker_thread_t::cond_mutex |
|
private |
§ done_condvar
| std::condition_variable worker_thread_t::done_condvar |
|
private |
§ interval_msec
| int worker_thread_t::interval_msec |
|
private |
Interval at which do_work is invoked, in milliseconds. If < 0: only invoked when explicitly woken up. If = 0: no timeout or wakeup necessary – run continuously If > 0: wait for this timeout or a wakeup signal, whatever comes first.
§ rounds_completed
| long worker_thread_t::rounds_completed |
|
private |
number of do_work() rounds already completed by the worker
§ stop_requested
| std::atomic<bool> worker_thread_t::stop_requested |
|
private |
whether this thread has been requested to stop.
§ wakeup_condvar
| std::condition_variable worker_thread_t::wakeup_condvar |
|
private |
§ wakeup_requested
| bool worker_thread_t::wakeup_requested |
|
private |
whether this thread has been requested to wakeup.
§ worker_busy
| bool worker_thread_t::worker_busy |
|
private |
whether this thread is currently busy (and not waiting for wakeup
The documentation for this class was generated from the following files: