Skip to content

Commit

Permalink
Num workers = cpu_count()
Browse files Browse the repository at this point in the history
  • Loading branch information
sloretz committed Sep 15, 2017
1 parent 4400150 commit 018513a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rclpy/executors/examples_rclpy_executors/custom_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

from concurrent.futures import ThreadPoolExecutor
import multiprocessing

from examples_rclpy_executors.listener import Listener
from examples_rclpy_executors.talker import Talker
Expand Down Expand Up @@ -45,7 +46,7 @@ class PriorityExecutor(Executor):
def __init__(self):
super().__init__()
self.high_priority_nodes = set()
self.hp_executor = ThreadPoolExecutor(max_workers=10)
self.hp_executor = ThreadPoolExecutor(max_workers=multiprocessing.cpu_count())
self.lp_executor = ThreadPoolExecutor(max_workers=1)

def add_high_priority_node(self, node):
Expand Down

0 comments on commit 018513a

Please sign in to comment.