File tree Expand file tree Collapse file tree
include/CXXGraph/Graph/Algorithm Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -147,7 +147,6 @@ const std::vector<Node<T>> Graph<T>::concurrency_breadth_first_search(
147147 // a worker is assigned a small part of tasks for each time
148148 // assignments of tasks in current level and updates of tasks in next
149149 // level are inclusive
150- std::mutex tracker_mutex;
151150 std::mutex next_tracker_mutex;
152151 std::atomic<int > assigned_tasks = 0 ;
153152 int num_tasks = 1 ;
@@ -158,13 +157,6 @@ const std::vector<Node<T>> Graph<T>::concurrency_breadth_first_search(
158157
159158 auto extract_tasks = [&assigned_tasks, &num_tasks,
160159 &block_size]() -> std::pair<int , int > {
161- /*
162- std::lock_guard<std::mutex> tracker_guard(tracker_mutex);
163- int task_block_size = std::min(num_tasks - assigned_tasks,
164- block_size); std::pair<int,int> task_block{assigned_tasks,
165- assigned_tasks + task_block_size}; assigned_tasks += task_block_size;
166- return task_block;
167- */
168160 int start = assigned_tasks.fetch_add (block_size);
169161 int end = std::min (num_tasks, start + block_size);
170162 return {start, end};
You can’t perform that action at this time.
0 commit comments