<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Yes, there are other ways, but I have a doubt on one of the basic method of sleeping -</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">set_current_state (TASK_INTERRUPTIBLE);</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">schedule ();</span><br style="font-family:arial,sans-serif;font-size:13px">
<br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">Is this a sure-shot way of putting a thread to sleep, or are there conditions when this may not put the calling thread into sleep?</span><div style="font-family:arial,sans-serif;font-size:13px">
<br><div>Almost always I see that the thread goes to sleep, until explicitly woken up by another thread. But, once it a blue moon, I find that thread executes the above instructions and does not go to sleep!<div class="">
<div id=":20l" class="" tabindex="0"><img class="" src="https://mail.google.com/mail/u/0/images/cleardot.gif"></div></div></div></div><div><br></div>-- <br>Joshi<br>
</div>