From ea78847e002c2f0b6b3653539cb2b94580aea690 Mon Sep 17 00:00:00 2001 From: Thomas Nagler Date: Thu, 27 Jan 2022 20:51:57 +0100 Subject: [PATCH] aligned allocation of vectors (#15) * aligned allocator for vectors * custom new/delete for ThreadPool * comments * finalize * allow throwing ThreadPool::new --- docs/Doxyfile | 2 +- docs/annotated.html | 2 +- docs/classes.html | 2 +- .../classquickpool_1_1ThreadPool-members.html | 4 +- docs/classquickpool_1_1ThreadPool.html | 26 +- docs/files.html | 2 +- docs/functions.html | 8 +- docs/functions_func.html | 8 +- docs/graph_legend.html | 2 +- docs/hierarchy.html | 90 + docs/index.html | 22 +- docs/inherit_graph_0.map | 3 + docs/inherit_graph_0.md5 | 1 + docs/inherit_graph_0.png | Bin 0 -> 2765 bytes docs/inherit_graph_1.map | 5 + docs/inherit_graph_1.md5 | 1 + docs/inherit_graph_1.png | Bin 0 -> 7735 bytes docs/inherit_graph_2.map | 3 + docs/inherit_graph_2.md5 | 1 + docs/inherit_graph_2.png | Bin 0 -> 3605 bytes docs/inherit_graph_3.map | 3 + docs/inherit_graph_3.md5 | 1 + docs/inherit_graph_3.png | Bin 0 -> 1696 bytes docs/inherits.html | 104 + docs/namespacemembers.html | 2 +- docs/namespacemembers_func.html | 2 +- docs/namespacequickpool.html | 12 +- docs/namespacequickpool_1_1padding__impl.html | 104 + docs/namespaces.html | 2 +- docs/quickpool_8hpp_source.html | 1704 +++++++++-------- docs/search/all_3.js | 5 +- docs/search/all_4.js | 5 +- docs/search/all_5.js | 3 +- docs/search/all_6.js | 2 +- docs/search/all_7.js | 2 +- docs/search/all_8.html | 30 + docs/search/all_8.js | 4 + docs/search/all_9.html | 30 + docs/search/all_9.js | 4 + docs/search/all_a.html | 30 + docs/search/all_a.js | 4 + docs/search/classes_0.js | 2 +- docs/search/classes_1.html | 30 + docs/search/classes_1.js | 6 + docs/search/classes_2.html | 30 + docs/search/classes_2.js | 4 + docs/search/functions_0.js | 2 +- docs/search/functions_1.js | 2 +- docs/search/functions_2.js | 4 +- docs/search/functions_3.js | 5 +- docs/search/functions_4.js | 4 +- docs/search/functions_5.js | 2 +- docs/search/functions_6.js | 2 +- docs/search/functions_7.html | 30 + docs/search/functions_7.js | 4 + docs/search/functions_8.html | 30 + docs/search/functions_8.js | 4 + docs/search/namespaces_0.js | 2 +- docs/search/pages_0.js | 2 +- docs/search/searchdata.js | 4 +- ...ool_1_1padding__impl_1_1empty__struct.html | 88 + ...quickpool_1_1padding__impl_1_1padding.html | 112 ++ ...dding__impl_1_1padding__bytes-members.html | 88 + ...ol_1_1padding__impl_1_1padding__bytes.html | 140 ++ ...1padding__impl_1_1padding__coll__graph.map | 4 + ...1padding__impl_1_1padding__coll__graph.md5 | 1 + ...1padding__impl_1_1padding__coll__graph.png | Bin 0 -> 8925 bytes ...dding__impl_1_1padding__inherit__graph.map | 4 + ...dding__impl_1_1padding__inherit__graph.md5 | 1 + ...dding__impl_1_1padding__inherit__graph.png | Bin 0 -> 8925 bytes docs/test_8cpp_source.html | 646 +++---- quickpool.hpp | 213 ++- test.cpp | 6 +- 73 files changed, 2441 insertions(+), 1266 deletions(-) create mode 100644 docs/hierarchy.html create mode 100644 docs/inherit_graph_0.map create mode 100644 docs/inherit_graph_0.md5 create mode 100644 docs/inherit_graph_0.png create mode 100644 docs/inherit_graph_1.map create mode 100644 docs/inherit_graph_1.md5 create mode 100644 docs/inherit_graph_1.png create mode 100644 docs/inherit_graph_2.map create mode 100644 docs/inherit_graph_2.md5 create mode 100644 docs/inherit_graph_2.png create mode 100644 docs/inherit_graph_3.map create mode 100644 docs/inherit_graph_3.md5 create mode 100644 docs/inherit_graph_3.png create mode 100644 docs/inherits.html create mode 100644 docs/namespacequickpool_1_1padding__impl.html create mode 100644 docs/search/all_8.html create mode 100644 docs/search/all_8.js create mode 100644 docs/search/all_9.html create mode 100644 docs/search/all_9.js create mode 100644 docs/search/all_a.html create mode 100644 docs/search/all_a.js create mode 100644 docs/search/classes_1.html create mode 100644 docs/search/classes_1.js create mode 100644 docs/search/classes_2.html create mode 100644 docs/search/classes_2.js create mode 100644 docs/search/functions_7.html create mode 100644 docs/search/functions_7.js create mode 100644 docs/search/functions_8.html create mode 100644 docs/search/functions_8.js create mode 100644 docs/structquickpool_1_1padding__impl_1_1empty__struct.html create mode 100644 docs/structquickpool_1_1padding__impl_1_1padding.html create mode 100644 docs/structquickpool_1_1padding__impl_1_1padding__bytes-members.html create mode 100644 docs/structquickpool_1_1padding__impl_1_1padding__bytes.html create mode 100644 docs/structquickpool_1_1padding__impl_1_1padding__coll__graph.map create mode 100644 docs/structquickpool_1_1padding__impl_1_1padding__coll__graph.md5 create mode 100644 docs/structquickpool_1_1padding__impl_1_1padding__coll__graph.png create mode 100644 docs/structquickpool_1_1padding__impl_1_1padding__inherit__graph.map create mode 100644 docs/structquickpool_1_1padding__impl_1_1padding__inherit__graph.md5 create mode 100644 docs/structquickpool_1_1padding__impl_1_1padding__inherit__graph.png diff --git a/docs/Doxyfile b/docs/Doxyfile index 58e9613..747874a 100644 --- a/docs/Doxyfile +++ b/docs/Doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "quickpool" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 1.3.0 +PROJECT_NUMBER = 1.4.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/docs/annotated.html b/docs/annotated.html index 8721880..aa8f360 100644 --- a/docs/annotated.html +++ b/docs/annotated.html @@ -22,7 +22,7 @@
quickpool -  1.3.0 +  1.4.0
An easy-to-use, header-only work stealing thread pool in C++11
diff --git a/docs/classes.html b/docs/classes.html index b6f5ce3..03995e0 100644 --- a/docs/classes.html +++ b/docs/classes.html @@ -22,7 +22,7 @@
quickpool -  1.3.0 +  1.4.0
An easy-to-use, header-only work stealing thread pool in C++11
diff --git a/docs/classquickpool_1_1ThreadPool-members.html b/docs/classquickpool_1_1ThreadPool-members.html index 7cc3970..f583565 100644 --- a/docs/classquickpool_1_1ThreadPool-members.html +++ b/docs/classquickpool_1_1ThreadPool-members.html @@ -22,7 +22,7 @@
quickpool -  1.3.0 +  1.4.0
An easy-to-use, header-only work stealing thread pool in C++11
@@ -78,6 +78,8 @@ done() constquickpool::ThreadPoolinline get_active_threads() constquickpool::ThreadPoolinline global_instance()quickpool::ThreadPoolinlinestatic + operator delete(void *ptr)quickpool::ThreadPoolinlinestatic + operator new(size_t count) noexceptquickpool::ThreadPoolinlinestatic operator=(const ThreadPool &)=delete (defined in quickpool::ThreadPool)quickpool::ThreadPool operator=(ThreadPool &&other)=delete (defined in quickpool::ThreadPool)quickpool::ThreadPool parallel_for(int begin, int end, UnaryFunction f)quickpool::ThreadPoolinline diff --git a/docs/classquickpool_1_1ThreadPool.html b/docs/classquickpool_1_1ThreadPool.html index 043977a..8b6d3c5 100644 --- a/docs/classquickpool_1_1ThreadPool.html +++ b/docs/classquickpool_1_1ThreadPool.html @@ -22,7 +22,7 @@
quickpool -  1.3.0 +  1.4.0
An easy-to-use, header-only work stealing thread pool in C++11
@@ -135,11 +135,19 @@ static ThreadPoolglobal_instance ()  returns a reference to the global thread pool instance.
  + +static void * operator new (size_t count) noexcept + allocator respecting memory alignment.
+  + +static void operator delete (void *ptr) + deallocator respecting memory alignment.

Detailed Description

A work stealing thread pool.

-

Definition at line 678 of file quickpool.hpp.

+

Definition at line 756 of file quickpool.hpp.

Constructor & Destructor Documentation

◆ ThreadPool()

@@ -173,7 +181,7 @@

Definition at line 684 of file quickpool.hpp.

+

Definition at line 762 of file quickpool.hpp.

@@ -225,7 +233,7 @@

Returns
A std::future for the task. Call future.get() to retrieve the results at a later point in time (blocking).
-

Definition at line 760 of file quickpool.hpp.

+

Definition at line 838 of file quickpool.hpp.

@@ -282,7 +290,7 @@

Definition at line 781 of file quickpool.hpp.

+

Definition at line 859 of file quickpool.hpp.

@@ -332,7 +340,7 @@

Definition at line 803 of file quickpool.hpp.

+

Definition at line 881 of file quickpool.hpp.

@@ -381,7 +389,7 @@

Definition at line 746 of file quickpool.hpp.

+

Definition at line 824 of file quickpool.hpp.

@@ -417,7 +425,7 @@

Definition at line 718 of file quickpool.hpp.

+

Definition at line 796 of file quickpool.hpp.

@@ -453,7 +461,7 @@

Definition at line 814 of file quickpool.hpp.

+

Definition at line 892 of file quickpool.hpp.

diff --git a/docs/files.html b/docs/files.html index db59962..894448e 100644 --- a/docs/files.html +++ b/docs/files.html @@ -22,7 +22,7 @@
quickpool -  1.3.0 +  1.4.0
An easy-to-use, header-only work stealing thread pool in C++11
diff --git a/docs/functions.html b/docs/functions.html index 6eba2e7..7fd0019 100644 --- a/docs/functions.html +++ b/docs/functions.html @@ -22,7 +22,7 @@
quickpool -  1.3.0 +  1.4.0
An easy-to-use, header-only work stealing thread pool in C++11
@@ -76,6 +76,12 @@
  • global_instance() : quickpool::ThreadPool
  • +
  • operator delete() +: quickpool::ThreadPool +
  • +
  • operator new() +: quickpool::ThreadPool +
  • parallel_for() : quickpool::ThreadPool
  • diff --git a/docs/functions_func.html b/docs/functions_func.html index 7799571..127cf35 100644 --- a/docs/functions_func.html +++ b/docs/functions_func.html @@ -22,7 +22,7 @@
    quickpool -  1.3.0 +  1.4.0
    An easy-to-use, header-only work stealing thread pool in C++11
    @@ -76,6 +76,12 @@
  • global_instance() : quickpool::ThreadPool
  • +
  • operator delete() +: quickpool::ThreadPool +
  • +
  • operator new() +: quickpool::ThreadPool +
  • parallel_for() : quickpool::ThreadPool
  • diff --git a/docs/graph_legend.html b/docs/graph_legend.html index 024d85d..d1ddaaf 100644 --- a/docs/graph_legend.html +++ b/docs/graph_legend.html @@ -22,7 +22,7 @@
    quickpool -  1.3.0 +  1.4.0
    An easy-to-use, header-only work stealing thread pool in C++11
    diff --git a/docs/hierarchy.html b/docs/hierarchy.html new file mode 100644 index 0000000..0bb0081 --- /dev/null +++ b/docs/hierarchy.html @@ -0,0 +1,90 @@ + + + + + + + +quickpool: Class Hierarchy + + + + + + + + + +
    +
    + + + + + + +
    +
    quickpool +  1.3.0 +
    +
    An easy-to-use, header-only work stealing thread pool in C++11
    +
    +
    + + + + + + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    Class Hierarchy
    +
    +
    +
    +

    Go to the graphical class hierarchy

    +This inheritance list is sorted roughly, but not completely, alphabetically:
    +
    + + + + diff --git a/docs/index.html b/docs/index.html index bc1d4b7..f1a6d74 100644 --- a/docs/index.html +++ b/docs/index.html @@ -22,7 +22,7 @@
    quickpool -  1.3.0 +  1.4.0
    An easy-to-use, header-only work stealing thread pool in C++11
    @@ -158,16 +158,16 @@

    pool.parallel_for_each(x, [] (double& xx) {});
    -
    void parallel_for(int begin, int end, UnaryFunction &&f)
    computes an index-based parallel for loop.
    Definition: quickpool.hpp:954
    -
    void parallel_for_each(Items &items, UnaryFunction &&f)
    computes a iterator-based parallel for loop.
    Definition: quickpool.hpp:971
    -
    auto async(Function &&f, Args &&... args) -> std::future< decltype(f(args...))>
    executes a job asynchronously the global thread pool.
    Definition: quickpool.hpp:905
    -
    void parallel_for(int begin, int end, UnaryFunction f)
    computes an index-based parallel for loop.
    Definition: quickpool.hpp:781
    -
    void wait(size_t millis=0)
    waits for all jobs currently running on the thread pool. Has no effect when called from threads other...
    Definition: quickpool.hpp:814
    -
    void parallel_for_each(Items &items, UnaryFunction f)
    computes a iterator-based parallel for loop.
    Definition: quickpool.hpp:803
    -
    void wait()
    waits for all jobs currently running on the global thread pool. Has no effect when not called from ma...
    Definition: quickpool.hpp:914
    -
    auto async(Function &&f, Args &&... args) -> std::future< decltype(f(args...))>
    executes a job asynchronously on the global thread pool.
    Definition: quickpool.hpp:760
    -
    void push(Function &&f, Args &&... args)
    pushes a job to the thread pool.
    Definition: quickpool.hpp:746
    -
    void push(Function &&f, Args &&... args)
    Free-standing functions (main API)
    Definition: quickpool.hpp:892
    +
    void parallel_for(int begin, int end, UnaryFunction &&f)
    computes an index-based parallel for loop.
    Definition: quickpool.hpp:1041
    +
    void parallel_for_each(Items &items, UnaryFunction &&f)
    computes a iterator-based parallel for loop.
    Definition: quickpool.hpp:1058
    +
    auto async(Function &&f, Args &&... args) -> std::future< decltype(f(args...))>
    executes a job asynchronously the global thread pool.
    Definition: quickpool.hpp:992
    +
    void parallel_for(int begin, int end, UnaryFunction f)
    computes an index-based parallel for loop.
    Definition: quickpool.hpp:859
    +
    void wait(size_t millis=0)
    waits for all jobs currently running on the thread pool. Has no effect when called from threads other...
    Definition: quickpool.hpp:892
    +
    void parallel_for_each(Items &items, UnaryFunction f)
    computes a iterator-based parallel for loop.
    Definition: quickpool.hpp:881
    +
    void wait()
    waits for all jobs currently running on the global thread pool. Has no effect when not called from ma...
    Definition: quickpool.hpp:1001
    +
    auto async(Function &&f, Args &&... args) -> std::future< decltype(f(args...))>
    executes a job asynchronously on the global thread pool.
    Definition: quickpool.hpp:838
    +
    void push(Function &&f, Args &&... args)
    pushes a job to the thread pool.
    Definition: quickpool.hpp:824
    +
    void push(Function &&f, Args &&... args)
    Free-standing functions (main API)
    Definition: quickpool.hpp:979