Skip to content

Commit

Permalink
add warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdhvdu committed Mar 31, 2019
1 parent 4681298 commit ff8653b
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Warnings
Since commit `f66048ed999aa1b50dc956c4a728ff565042d761`, I move ThreadPool to C++17. (To use `std::apply`.)<br>
In addition, **the rule of passing parameters to ThreadPool is different.**<br>
Unlike before, which uses `std::bind`, **ThreadPool will not copy anything right now.**<br>
All of ThreadPool does is forward (**no decay**).<br>
This means you have to copy arguments by yourself before passing it to ThreadPool.
# Contents
[Introduction](https://github.com/Fdhvdu/ThreadPool/blob/master/README.md#introduction)<br>
[Class view](https://github.com/Fdhvdu/ThreadPool/blob/master/README.md#class-view)<br>
Expand Down Expand Up @@ -33,7 +39,7 @@ Two classes
void wait_all() const
Use the CThreadPool_Ret when you want to get the return value of function.<br>
Use the CThreadPool when you don't care the return value of function.<br>
CThreadPool::add_and_detach is faster (very) than CThreadPool_Ret::add.
`CThreadPool::add_and_detach` is faster (very) than `CThreadPool_Ret::add`.
# Performance comparison
[progschj/ThreadPool](https://github.com/progschj/ThreadPool), see [Comparison](comparison/README.md#result).<br>
[Tyler-Hardin/thread_pool](https://github.com/Tyler-Hardin/thread_pool), see [Comparison](comparison/README.md#result).<br>
Expand All @@ -43,8 +49,9 @@ P.S. [philipphenkel/threadpool](https://github.com/philipphenkel/threadpool) can
P.S. [tghosgor/threadpool11](https://github.com/tghosgor/threadpool11) cannot pass testing, see [README](comparison/tghosgor/README.md#warning).<br>
See the [directory](comparison/) for more details.
# Compiler
VC++ 14.2<br>
or any compiler which supports C++14
Visual Studio 2017 15.5.5
g++ 7.2.1
clang++ 5.0.1
# How to compile
You have to download [my lib](https://github.com/Fdhvdu/lib) first.<br>
The directory should be look like
Expand All @@ -64,16 +71,14 @@ The directory should be look like
└── tutorial
Don't forget to compile lib/src/CScopeGuard.cpp.
# Compilation errors?
Q: My compiler doesn't support C++14<br>
A: Get a newer compiler version, such as GCC 5.3.0 or VC++ 14.2 (inside Visual Studio Community 2015 Update 2)<br><br>
Q: Other problems<br>
A: See [How to compile](https://github.com/Fdhvdu/ThreadPool/blob/master/README.md#how-to-compile) or email me
See [How to compile](https://github.com/Fdhvdu/ThreadPool/blob/master/README.md#how-to-compile) or email me
# Tutorial
I provide [example.cpp](tutorial/example.cpp) and [example_ret.cpp](tutorial/example_ret.cpp) to help you understand how to use this powerful thread pool<br>
To use [example.cpp](tutorial/example.cpp):<br>
g++ -std=c++14 tutorial/example.cpp src/* ../lib/src/CScopeGuard.cpp<br>

g++ -std=c++17 tutorial/example.cpp src/* ../lib/src/CScopeGuard.cpp<br>
To use [example_ret.cpp](tutorial/example_ret.cpp):<br>
g++ -std=c++14 tutorial/example_ret.cpp src/IThreadPoolItemBase.cpp ../lib/src/CScopeGuard.cpp

g++ -std=c++17 tutorial/example_ret.cpp src/IThreadPoolItemBase.cpp ../lib/src/CScopeGuard.cpp
# Future work
replace std::bind in CThreadPool::add, CThreadPool::add_and_detach and CThreadPool_Ret::add with C++17 std::apply<br>
work stealing

0 comments on commit ff8653b

Please sign in to comment.