|
Thrill
0.1
|
Definition at line 32 of file profile_thread.hpp.
Collaboration diagram for ProfileThread:#include <profile_thread.hpp>
Classes | |
| struct | Timer |
| struct for timer callbacks More... | |
Public Types | |
| using | milliseconds = std::chrono::milliseconds |
| using | steady_clock = std::chrono::steady_clock |
Public Member Functions | |
| ProfileThread () | |
| ProfileThread (const ProfileThread &)=delete | |
| non-copyable: delete copy-constructor More... | |
| ~ProfileThread () | |
| template<typename Period > | |
| void | Add (const Period &period, ProfileTask *task, bool own_task=false) |
| Register a regularly scheduled callback. More... | |
| ProfileThread & | operator= (const ProfileThread &)=delete |
| non-copyable: delete assignment operator More... | |
| bool | Remove (ProfileTask *task) |
| Unregister a regularly scheduled callback. More... | |
Private Types | |
| using | TimerPQ = BinaryHeap< Timer > |
| priority queue of interval scheduled callbacks More... | |
Private Member Functions | |
| void | Worker () |
| the thread worker function More... | |
Private Attributes | |
| std::condition_variable_any | cv_ |
| cv/mutex pair to signal thread to terminate More... | |
| std::timed_mutex | mutex_ |
| cv/mutex pair to signal thread to terminate More... | |
| TimerPQ | tasks_ |
| priority queue of interval scheduled callbacks More... | |
| std::atomic< bool > | terminate_ { false } |
| flag to terminate profiling thread More... | |
| std::thread | thread_ |
| thread for profiling (only run on top-level loggers) More... | |
| using milliseconds = std::chrono::milliseconds |
Definition at line 35 of file profile_thread.hpp.
| using steady_clock = std::chrono::steady_clock |
Definition at line 36 of file profile_thread.hpp.
|
private |
priority queue of interval scheduled callbacks
Definition at line 92 of file profile_thread.hpp.
| ProfileThread | ( | ) |
Definition at line 24 of file profile_thread.cpp.
References thrill::common::g_profile_thread, ProfileThread::thread_, and ProfileThread::Worker().
|
delete |
non-copyable: delete copy-constructor
| ~ProfileThread | ( | ) |
Definition at line 29 of file profile_thread.cpp.
References BinaryHeap< Type, Compare >::container(), ProfileThread::cv_, thrill::common::g_profile_thread, ProfileThread::mutex_, ProfileThread::tasks_, ProfileThread::terminate_, and ProfileThread::thread_.
|
inline |
Register a regularly scheduled callback.
Definition at line 49 of file profile_thread.hpp.
References ProfileThread::cv_, BinaryHeap< Type, Compare >::emplace(), ProfileThread::mutex_, ProfileThread::Remove(), and ProfileThread::tasks_.
Referenced by ProfileTaskRegistration::ProfileTaskRegistration(), and thrill::mem::StartMemProfiler().
|
delete |
non-copyable: delete assignment operator
| bool Remove | ( | ProfileTask * | task | ) |
Unregister a regularly scheduled callback.
Definition at line 44 of file profile_thread.cpp.
References BinaryHeap< Type, Compare >::erase(), ProfileThread::mutex_, ProfileThread::Timer::task, and ProfileThread::tasks_.
Referenced by ProfileThread::Add(), and ProfileTaskRegistration::~ProfileTaskRegistration().
|
private |
the thread worker function
Definition at line 49 of file profile_thread.cpp.
References ProfileThread::cv_, BinaryHeap< Type, Compare >::emplace(), BinaryHeap< Type, Compare >::empty(), ProfileThread::mutex_, ProfileThread::Timer::next_timeout, ProfileThread::Timer::own_task, ProfileThread::Timer::period, BinaryHeap< Type, Compare >::pop(), ProfileTask::RunTask(), ProfileThread::Timer::task, ProfileThread::tasks_, ProfileThread::terminate_, and BinaryHeap< Type, Compare >::top().
Referenced by ProfileThread::ProfileThread().
|
private |
cv/mutex pair to signal thread to terminate
Definition at line 71 of file profile_thread.hpp.
Referenced by ProfileThread::Add(), ProfileThread::Worker(), and ProfileThread::~ProfileThread().
|
private |
cv/mutex pair to signal thread to terminate
Definition at line 68 of file profile_thread.hpp.
Referenced by ProfileThread::Add(), ProfileThread::Remove(), ProfileThread::Worker(), and ProfileThread::~ProfileThread().
|
private |
priority queue of interval scheduled callbacks
Definition at line 95 of file profile_thread.hpp.
Referenced by ProfileThread::Add(), ProfileThread::Remove(), ProfileThread::Worker(), and ProfileThread::~ProfileThread().
|
private |
flag to terminate profiling thread
Definition at line 65 of file profile_thread.hpp.
Referenced by ProfileThread::Worker(), and ProfileThread::~ProfileThread().
|
private |
thread for profiling (only run on top-level loggers)
Definition at line 62 of file profile_thread.hpp.
Referenced by ProfileThread::ProfileThread(), and ProfileThread::~ProfileThread().