Added license information.

This commit is contained in:
Samer Afach 2017-06-08 06:50:32 +02:00
parent 375d5a38b1
commit 2b8accbb55
2 changed files with 49 additions and 0 deletions

36
README.md Normal file
View File

@ -0,0 +1,36 @@
# Simple Thread Pool for C++11
This is a very simple implementation of a ThreadPool based on std::thread. It's written to be simple, not versatile. It works very efficiently for coarse-grained tasks (hence, no multi-pool task-stealing from other threads, etc...).
### License
MIT. In other words, you're free to do with this code whatever you want. Enjoy!
Terms (in short words):
-You're free to do anything you wish with this simple library, including any embedding or modifications you wish, with static or dynamic linking (you can't dynamically link it... it's header only! :-) ).
-The creator of this library is not to be help liable for anything you do with it. Using this library is your own responsibility
### Usage
There is an example on how to use the code in the directory `examples`.
Other than that, all you have to do is:
* Include the file `ThreadPool.h` (the library is header-only, no need for sources)
* Start coding!
Using the code is very simple. All you have to do is:
* Create an object `ThreadPool pool`
* Use the member function `pool.push(function)`, to add tasks to the pool, where `function` is a function object (functor) of the task of type void().
* Call `pool.finish()`, which will block until all tasks are finished.
Note: Return values in the `function` are omitted.
Note: The task function's signature is void function(). If you need to parametrize the function, use std::bind or lambdas.
### Makefiles
There's a make file that builds the example. There's also a qmake file that builds the example too.
### Credits
This library was written by Samer Afach, find this code in the repository git.afach.de

View File

@ -1,3 +1,16 @@
/**
This library was written by Samer Afach, find this code in the repository
git.afach.de, 2017
Terms of use:
-You're free to do anything you wish with this simple library, including any
embedding or modifications you wish, with static or dynamic linking (you can't
dynamically link it... it's header only! :-) ).
-The creator of this library is not to be help liable for anything you do with
it. Using this library is your own responsibility
*/
#ifndef THREADPOOL_H
#define THREADPOOL_H