# \_\_syncthreads and thread-scheduling Scheduling intelligence

**URL:** <https://forums.developer.nvidia.com/t/syncthreads-and-thread-scheduling-scheduling-intelligence/2154>\
**Category:** CUDA Programming and Performance\
**Created:** [December 19, 2007, 2:43am UTC](https://forums.developer.nvidia.com/t/syncthreads-and-thread-scheduling-scheduling-intelligence/2154 "2007-12-19T02:43:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sarnath](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sarnath/32/9742_2.png) [@Sarnath](https://forums.developer.nvidia.com/u/Sarnath)\
**Post date:** [December 19, 2007, 2:43am UTC](https://forums.developer.nvidia.com/t/syncthreads-and-thread-scheduling-scheduling-intelligence/2154/1 "2007-12-19T02:43:27Z")

</div>

I want to know what is the cost of a “\_\_syncthreads” operation.

If lets say , a WARP (all threads in the WARP) execute \_\_syncthreads() , does the WARP scheduler MARK this WARP as in WAITING state and never schedules until all threads in the block reach that place???

OR

Does \_\_syncthreads cause the WARP to do some idle-looping until all threads sync together ???

Basically, I want to know how intelligent or dumb, the WARP scheduler is.

---

<div class="post-metadata">

**Author:** ![hab](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hab](https://forums.developer.nvidia.com/u/hab)\
**Post date:** [December 19, 2007, 7:06am UTC](https://forums.developer.nvidia.com/t/syncthreads-and-thread-scheduling-scheduling-intelligence/2154/2 "2007-12-19T07:06:34Z")

</div>

> [@](#):
>
> I want to know what is the cost of a “\_\_syncthreads” operation.
> 
> If lets say , a WARP (all threads in the WARP) execute \_\_syncthreads() , does the WARP scheduler MARK this WARP as in WAITING state and never schedules until all threads in the block reach that place???
> 
> OR
> 
> Does \_\_syncthreads cause the WARP to do some idle-looping until all threads sync together ???
> 
> Basically, I want to know how intelligent or dumb, the WARP scheduler is.
> 
> [snapback]296706[/snapback]

I recomend Listening and viewing the Slides of Dr. Hwu lecture on Threading Hardware Fall Lecture 7. See Faq Question 11. My interpretation is that once a warp has reached the sync point is that it is no longer elgible for execution. Priority is given to the least recently executed warp elgible for execution until all warps have reached the sync point and all warps in the block are released for sceduling
