|
mCRL2
|
This is a thread's specific access to the global aterm pool which ensures that garbage collection and hash table resizing can proceed. More...
#include <thread_aterm_pool.h>
Public Member Functions | |
| thread_aterm_pool (aterm_pool &global_pool) | |
| ~thread_aterm_pool () | |
| function_symbol | create_function_symbol (const std::string &name, std::size_t arity, bool check_for_registered_functions=false) |
| function_symbol | create_function_symbol (std::string &&name, std::size_t arity, bool check_for_registered_functions=false) |
| void | create_int (aterm &term, std::size_t val) |
| void | create_term (aterm &term, const function_symbol &sym) |
| template<class ... Terms> | |
| void | create_appl (aterm &term, const function_symbol &sym, const Terms &... arguments) |
| template<class Term , class INDEX_TYPE , class ... Terms> | |
| void | create_appl_index (aterm &term, const function_symbol &sym, const Terms &... arguments) |
| template<typename ForwardIterator > | |
| void | create_appl_dynamic (aterm &term, const function_symbol &sym, ForwardIterator begin, ForwardIterator end) |
| template<typename InputIterator , typename ATermConverter > | |
| void | create_appl_dynamic (aterm &term, const function_symbol &sym, ATermConverter convert_to_aterm, InputIterator begin, InputIterator end) |
| void | register_variable (aterm_core *variable) |
| Consider the given variable when marking underlying terms. | |
| void | deregister_variable (aterm_core *variable) |
| Removes the given variable from the active variables. | |
| void | register_container (aterm_container *variable) |
| Consider the given container when marking underlying terms. | |
| void | deregister_container (aterm_container *variable) |
| Removes the given container from the active variables. | |
| void | absorb (mcrl2::utilities::hashtable< aterm_core * > &variables, mcrl2::utilities::hashtable< aterm_container * > &containers) |
| Transfers the surviving variables and containers of a pool that is being destroyed into this pool. | |
| void | mark () |
| void | print_local_performance_statistics () const |
| std::size_t | protection_set_size () const |
| mcrl2::utilities::shared_guard | lock_shared () |
| Acquire a shared lock on this thread aterm pool. | |
| mcrl2::utilities::lock_guard | lock () |
| Acquire an exclusive lock. | |
| bool | is_shared_locked () |
| Returns true iff we are in a shared section. | |
| mcrl2::utilities::shared_mutex & | shared_mutex () |
| Provides access to the underlying shared mutex. | |
| void | collect () |
| Triggers a global garbage collection. | |
| bool | resize_is_needed () |
| void | resize () |
| Resizes the global hash tables when needed. | |
| template<typename InputIterator > | |
| void | create_appl_dynamic (aterm &term, const function_symbol &sym, InputIterator begin, InputIterator end) |
Public Member Functions inherited from mcrl2::utilities::noncopyable | |
| noncopyable ()=default | |
| ~noncopyable ()=default | |
| noncopyable (noncopyable &&)=default | |
| noncopyable & | operator= (noncopyable &&)=default |
| noncopyable (const noncopyable &)=delete | |
| noncopyable & | operator= (const noncopyable &)=delete |
Private Attributes | |
| aterm_pool & | m_pool |
| mcrl2::utilities::shared_mutex | m_shared_mutex |
| Keeps track of pointers to all existing aterm variables and containers. | |
| mcrl2::utilities::hashtable< aterm_core * > * | m_variables |
| mcrl2::utilities::hashtable< detail::aterm_container * > * | m_containers |
| std::size_t | m_variable_insertions = 0 |
| std::size_t | m_container_insertions = 0 |
| std::stack< std::reference_wrapper< _aterm > > | m_todo |
| A reusable todo stack. | |
| long | m_count_until_check |
| bool | m_is_main_thread = false |
| thread_aterm_pool_interface | m_thread_interface |
| The registered thread aterm pool. | |
This is a thread's specific access to the global aterm pool which ensures that garbage collection and hash table resizing can proceed.
Definition at line 34 of file thread_aterm_pool.h.
|
inline |
Identify the first constructor call as the main thread.
Definition at line 37 of file thread_aterm_pool.h.
|
inline |
Definition at line 57 of file thread_aterm_pool.h.
|
inline |
Transfers the surviving variables and containers of a pool that is being destroyed into this pool.
Takes no lock itself; the caller must already hold its own exclusive lock (see ~thread_aterm_pool()).
Definition at line 175 of file thread_aterm_pool_implementation.h.
|
inline |
Triggers a global garbage collection.
Definition at line 165 of file thread_aterm_pool.h.
|
inline |
threadsafe
Definition at line 55 of file thread_aterm_pool_implementation.h.
|
inline |
Definition at line 114 of file thread_aterm_pool_implementation.h.
|
inline |
threadsafe
| void atermpp::detail::thread_aterm_pool::create_appl_dynamic | ( | aterm & | term, |
| const function_symbol & | sym, | ||
| InputIterator | begin, | ||
| InputIterator | end | ||
| ) |
Definition at line 101 of file thread_aterm_pool_implementation.h.
|
inline |
threadsafe
Definition at line 65 of file thread_aterm_pool_implementation.h.
|
inline |
threadsafe
Definition at line 30 of file thread_aterm_pool_implementation.h.
|
inline |
threadsafe
Definition at line 23 of file thread_aterm_pool_implementation.h.
|
inline |
threadsafe
Definition at line 36 of file thread_aterm_pool_implementation.h.
|
inline |
threadsafe
Definition at line 45 of file thread_aterm_pool_implementation.h.
|
inline |
Removes the given container from the active variables.
Definition at line 169 of file thread_aterm_pool_implementation.h.
|
inline |
Removes the given variable from the active variables.
Definition at line 146 of file thread_aterm_pool_implementation.h.
|
inline |
Returns true iff we are in a shared section.
Definition at line 159 of file thread_aterm_pool.h.
|
inline |
Acquire an exclusive lock.
Definition at line 156 of file thread_aterm_pool.h.
|
inline |
Acquire a shared lock on this thread aterm pool.
Definition at line 153 of file thread_aterm_pool.h.
|
inline |
Definition at line 205 of file thread_aterm_pool_implementation.h.
|
inline |
Definition at line 231 of file thread_aterm_pool_implementation.h.
|
inline |
Definition at line 240 of file thread_aterm_pool_implementation.h.
|
inline |
Consider the given container when marking underlying terms.
Definition at line 152 of file thread_aterm_pool_implementation.h.
|
inline |
Consider the given variable when marking underlying terms.
Definition at line 127 of file thread_aterm_pool_implementation.h.
|
inline |
Resizes the global hash tables when needed.
Definition at line 173 of file thread_aterm_pool.h.
|
inline |
Returns true iff one of the global hash tables has to be resized.
Only takes a shared lock, as opposed to resize() below, so it can be used to avoid suspending all other threads when no resize is needed.
Definition at line 170 of file thread_aterm_pool.h.
|
inline |
Provides access to the underlying shared mutex.
Definition at line 162 of file thread_aterm_pool.h.
|
private |
Definition at line 184 of file thread_aterm_pool.h.
|
private |
Definition at line 181 of file thread_aterm_pool.h.
|
private |
Definition at line 187 of file thread_aterm_pool.h.
|
private |
Definition at line 190 of file thread_aterm_pool.h.
|
private |
Definition at line 176 of file thread_aterm_pool.h.
|
private |
Keeps track of pointers to all existing aterm variables and containers.
Definition at line 179 of file thread_aterm_pool.h.
|
private |
The registered thread aterm pool.
Definition at line 193 of file thread_aterm_pool.h.
|
private |
A reusable todo stack.
Definition at line 185 of file thread_aterm_pool.h.
|
private |
Definition at line 183 of file thread_aterm_pool.h.
|
private |
Definition at line 180 of file thread_aterm_pool.h.