Sleep Command in UNIX Shell Scripting

Reply

Join Date: Jun 2006
Posts: 1
Reputation: vanii is an unknown quantity at this point 
Solved Threads: 0
vanii vanii is offline Offline
Newbie Poster

Sleep Command in UNIX Shell Scripting

 
0
  #1
Jun 14th, 2006
Hi all,
I want to know whether "sleep command in shell scripting is a guarenteed command or not "

In java 'Sleep() ' is not guarenteed to be called when CPU is Idle.

Regards,
VANII
Reply With Quote Quick reply to this message  
Join Date: May 2004
Posts: 178
Reputation: jim mcnamara is on a distinguished road 
Solved Threads: 10
jim mcnamara jim mcnamara is offline Offline
Junior Poster

Re: Sleep Command in UNIX Shell Scripting

 
0
  #2
Jun 14th, 2006
The sleep command in unix is guaranteed to sleep a minimum.
Due to the way quanta (time slices) work in OS schedulers, other processes may get the cpu ahead of the sleeper who just awoke.

ie., there is no guarantee of an upper limit. sleep 1 may last longer than 1 second.

Linux sleep calls nanosleep - read the man page for that.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC