scc 2025.09
SystemC components library
scc::sc_thread_pool Class Reference

A thread pool for executing tasks concurrently. More...

#include <sc_thread_pool.h>

Inheritance diagram for scc::sc_thread_pool:
Collaboration diagram for scc::sc_thread_pool:

Public Member Functions

 sc_thread_pool ()
 Constructor for the sc_thread_pool class.
virtual ~sc_thread_pool ()
 Destructor for the sc_thread_pool class.
void execute (std::function< void(void)> fct)
 Execute the given function in a separate SC_THREAD.

Public Attributes

cci::cci_param< unsigned > max_concurrent_threads {"max_concurrent_threads", 16}
 The maximum number of concurrent threads in the thread pool.

Detailed Description

A thread pool for executing tasks concurrently.

The sc_thread_pool class provides a mechanism for executing SystemC tasks concurrently using a pool of worker SC_THREADs. It allows users to specify the maximum number of concurrent threads and provides a simple interface for submitting tasks to be executed.

Author
Your Name
Date
YYYY-MM-DD

Definition at line 39 of file sc_thread_pool.h.

Constructor & Destructor Documentation

◆ sc_thread_pool()

scc::sc_thread_pool::sc_thread_pool ( )

Constructor for the sc_thread_pool class.

Definition at line 27 of file sc_thread_pool.cpp.

Member Function Documentation

◆ execute()

void scc::sc_thread_pool::execute ( std::function< void(void)> fct)

Execute the given function in a separate SC_THREAD.

This method submits the given function to be executed in a separate thread. The function will be executed concurrently with other tasks submitted to the thread pool.

Parameters
fctThe function to be executed.

Definition at line 32 of file sc_thread_pool.cpp.

Member Data Documentation

◆ max_concurrent_threads

cci::cci_param<unsigned> scc::sc_thread_pool::max_concurrent_threads {"max_concurrent_threads", 16}

The maximum number of concurrent threads in the thread pool.

This parameter allows users to specify the maximum number of concurrent threads that can be active in the thread pool at any given time. By default, the maximum number of concurrent threads is set to 16.

Definition at line 47 of file sc_thread_pool.h.


The documentation for this class was generated from the following files: