Where the Magic Happens
It’s been a long way, but finally, we are ready to traverse the graph and execute the nodes. Each of the spawned threads, and the main thread call thread_main.
```c++
auto Engine::thread_main(const std::shared_ptr& graph_task) -> void {
while (graph_task == nullptr || !graph_task->future_result_->completed()) {
    std::shared_ptr local_graph_task;
    {
      NodeTask task = local_ready_queue->pop();
  if (task.isShutdownTask_) {
    break;
  }

  if (!(local_graph_task = task.base_.lock())) {
    // GraphTask for function is no longer valid, skipping further
    // execution.
    continue;
  }

  if (task.fn_ && !local_graph_task->has_error_.load()) {
    at::ThreadLocalStateGuard tls_guard(local_graph_task->thread_locals_);

    try {
      GraphTaskGuard guard(local_graph_task);
