10#ifndef ATERMPP_DETAIL_THREAD_ATERM_POOL_H
11#define ATERMPP_DETAIL_THREAD_ATERM_POOL_H
38 static bool is_main_thread =
true;
42 is_main_thread =
false;
71 template<
class ...Terms>
75 template<
class Term,
class INDEX_TYPE,
class ...Terms>
79 template<
typename ForwardIterator>
82 ForwardIterator begin,
86 template<
typename InputIterator,
typename ATermConverter>
89 ATermConverter convert_to_aterm,
132 std::stack<std::reference_wrapper<_aterm>>
m_todo;
The aterm_core base class that provides protection of the underlying shared terms.
Provides safe storage of unprotected_aterm_core instances in a container by marking them during garba...
The interface for the term library. Provides the storage of of all classes of terms.
void collect(mcrl2::utilities::shared_mutex &mutex)
Force garbage collection on all storages.
A thread specific aterm pool that provides a local interface to the global term pool....
This is a thread's specific access to the global aterm pool which ensures that garbage collection and...
void collect()
Triggers a global garbage collection.
void deregister_container(aterm_container *variable)
Removes the given container from the active variables.
void register_container(aterm_container *variable)
Consider the given container when marking underlying terms.
mcrl2::utilities::shared_mutex m_shared_mutex
Keeps track of pointers to all existing aterm variables and containers.
void create_int(aterm &term, std::size_t val)
thread_aterm_pool_interface m_thread_interface
The registered thread aterm pool.
void create_appl(aterm &term, const function_symbol &sym, const Terms &... arguments)
thread_aterm_pool(aterm_pool &global_pool)
function_symbol create_function_symbol(const std::string &name, const std::size_t arity, const bool check_for_registered_functions=false)
void deregister_variable(aterm_core *variable)
Removes the given variable from the active variables.
void create_term(aterm &term, const function_symbol &sym)
bool is_shared_locked()
Returns true iff we are in a shared section.
mcrl2::utilities::hashtable< detail::aterm_container * > * m_containers
mcrl2::utilities::hashtable< aterm_core * > * m_variables
std::size_t protection_set_size() const
std::size_t m_container_insertions
std::stack< std::reference_wrapper< _aterm > > m_todo
A reusable todo stack.
void create_appl_dynamic(aterm &term, const function_symbol &sym, ForwardIterator begin, ForwardIterator end)
void register_variable(aterm_core *variable)
Consider the given variable when marking underlying terms.
std::size_t m_variable_insertions
mcrl2::utilities::lock_guard lock()
Acquire an exclusive lock.
void print_local_performance_statistics() const
void create_appl_index(aterm &term, const function_symbol &sym, const Terms &... arguments)
mcrl2::utilities::shared_guard lock_shared()
Acquire a shared lock on this thread aterm pool.
A set that assigns each element an unique index.
An exclusive lock guard for the shared_mutex.
Inherit from this class to prevent it from being copyable.
A shared lock guard for the shared_mutex.
bool is_shared_locked() const
shared_guard lock_shared()
thread_aterm_pool & g_thread_term_pool()
A reference to the thread local term pool storage.
The main namespace for the aterm++ library.
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...