Skip to content

Commit e7436fe

Browse files
updated README
1 parent 3f11c4c commit e7436fe

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ target_link_libraries(threadpool_cxx14 Threads::Threads)
114114
add_executable(multiple_dispatch example/multiple_dispatch.cpp)
115115
target_link_libraries(multiple_dispatch Threads::Threads)
116116

117-
118117
# -----------------------------------------------------------------------------
119118
# Unittest
120119
# -----------------------------------------------------------------------------

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,7 @@ Cpp-Taskflow is being actively developed and contributed by the following people
745745
- [Vladyslav](https://github.com/innermous) fixed comment errors in README.md and examples.
746746
- [vblanco20-1](https://github.com/vblanco20-1) fixed compilation error on Microsoft Visual Studio.
747747
- [Glen Fraser](https://github.com/totalgee) created a standalone C++14-compatible [threadpool](./taskflow/threadpool/threadpool_cxx14.hpp) for taskflow; various other fixes and examples.
748+
- [Guannan Guo](https://github.com/gguo4) added different threadpool implementations to enhance the performance for taskflow.
748749

749750
Meanwhile, we appreciate the support from many organizations for our development on Cpp-Taskflow.
750751
Please [let me know][email me] if I forgot someone!

example/multiple_dispatch.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// 2018/09/04 - contributed by Glen F.
2+
//
13
// An example to show dispatching multiple Taskflow graphs as
24
// separate batches (which will all run on the same Threadpool).
35
//
@@ -8,15 +10,17 @@
810

911
#include <taskflow/taskflow.hpp>
1012

13+
// Procedure: syncLog
14+
// synchronize cout across threads
1115
void syncLog(std::string const& msg)
1216
{
1317
static std::mutex logMutex;
1418
std::lock_guard<std::mutex> lock(logMutex);
1519
std::cout << msg << '\n';
1620
}
1721

18-
void dispatchBatch(tf::Taskflow& tf, int batch)
19-
{
22+
void dispatchBatch(tf::Taskflow& tf, int batch) {
23+
2024
auto taskMaker = [](std::string const& taskName, int batch) {
2125
return [=]() {
2226
// Simulate some work
@@ -37,6 +41,7 @@ void dispatchBatch(tf::Taskflow& tf, int batch)
3741
C.precede(D); // D runs after C
3842

3943
// Schedule this independent graph of tasks (so they start running)
44+
// We use silent_dispatch because we don't care when it finishes.
4045
tf.silent_dispatch();
4146
}
4247

0 commit comments

Comments
 (0)