@@ -32,15 +32,18 @@ It should be noted that these are not “threads” in the real computer-science
3232There are many examples showing many ways to use it. Here, we will explain Class itself,
3333what it does and "how" it does.
3434
35- There are basicaly, two Classes included in this Library:
36- ` Thread ` and ` ThreadController ` (that inherits from Thread).
35+ There are basicaly, three Classes included in this Library:
36+ ` Thread ` , ` ThreadController ` and ` StaticThreadController ` (both controllers inherit from Thread).
3737
3838- ` Thread class ` : This is the basic class, witch contains methods to set and run callbacks,
3939 check if the Thread should be runned, and also creates a unique ThreadID on the instantiation.
4040
4141- ` ThreadController class ` : Responsable for "holding" multiple Threads. Can also be called
4242 as "a group of Threads", and is used to perform run in every Thread ONLY when needed.
4343
44+ - ` StaticThreadController class ` : Slighly faster and smaller version of ` ThreadController ` .
45+ It works similar to ` ThreadController ` , but once constructed it can't add or remove threads to run.
46+
4447* The instantiation of a Thread class is very simple:
4548
4649``` c++
@@ -93,9 +96,9 @@ controller.add(&sensorReadings);
9396```
9497or
9598``` c++
96- // Instantiate a new StaticThreadController
97- StaticThreadController<2 > controller (Thread(my_callback, my_interval), Thread(his_callback, his_interval) );
98- // You don't need to do anything else, the treads will be created and kept inside controller
99+ // Instantiate a new StaticThreadController with the number of threads to be supplied as template parameter
100+ StaticThreadController<3 > controller (&myThread, &hisThread, &sensorReadings );
101+ // You don't need to do anything else, controller now contains all the threads.
99102...
100103```
101104
@@ -136,7 +139,8 @@ inside another). Check `ControllerInController` example.
136139
137140* There is a ` StaticThreadController ` which is better to use when you know exact number of
138141threads to run. You cannot add or remove threads in runtime, but ` StaticThreadController `
139- doesn't have any memory overhead to keep all the treads together, also the code may be slighly
142+ doesn't have additional memory overhead to keep all the treads together, doesn't have any
143+ limitations how many threads to store (except of available memory) and also the code may be slighly
140144more optimized because all the threads always exist and no need to do any runtime checks.
141145
142146* Check the full example ` CustomTimedThread ` for a cool application of Threads that runs
0 commit comments