docs/release-3-8-0.html
| | Taskflow: A General-purpose Task-parallel Programming System |
Loading...
Searching...
No Matches
Release 3.8.0 (2024/10/02)
This releases (1) enhances the scheduling performance through C++20 atomic notification and a bounded queue strategy and (2) revised the semaphore model for better runtime control.
Taskflow 3.8.0 can be downloaded from here.
To use Taskflow v3.8.0, you need a compiler that supports C++17:
Taskflow works on Linux, Windows, and Mac OS X.
AttentionAlthough Taskflow supports primarily C++17, you can enable C++20 compilation through -std=c++20 to achieve better performance due to new C++20 features.
~$ g++ -std=c++20 my_taskflow.cpp
tf::Executor executor(8); // create an executor of 8 workers
tf::Taskflow taskflow;
tf::Semaphore semaphore(1); // create a semaphore with initial count 1
for(size_t i=0; i<1000; i++) {
taskflow.emplace([&](tf::Runtime& rt){
rt.acquire(semaphore);
std::cout << "critical section here (one worker here only)\n";
critical_section();
rt.release(semaphore);
});
}
executor.run(taskflow).wait();
class to create an executor
Definition executor.hpp:62
Task emplace(C &&callable)
creates a static task
Definition flow_builder.hpp:1571
class to create a runtime task
Definition runtime.hpp:47
class to create a semophore object for building a concurrency constraint
Definition semaphore.hpp:68
class to create a taskflow object
Definition taskflow.hpp:64
Please do not hesitate to contact Dr. Tsung-Wei Huang if you intend to collaborate with us on using Taskflow in your scientific computing projects.