How can thread2 steal form thread1 here? Shouldn't the threads steal work from the calling thread, which is T0? Why does thread1 enqueue any work?
AnonyMouse
I believe that each thread can steal from the work-queue of any non-idle thread and it doesn't have to be T0. In fact, the idle threads in Cilk's scheduler (called "thiefs") apparently choose a busy thread at random (called a "victim") and steal a task from the victim's work-queue to execute. Here's a more in depth documentation which was an interesting read: https://www.usenix.org/legacy/publications/library/proceedings/ana97/full_papers/blumofe/blumofe_html/node2.html
How can thread2 steal form thread1 here? Shouldn't the threads steal work from the calling thread, which is T0? Why does thread1 enqueue any work?