View Single Post
  #9   Spotlight this post!  
Unread 18-02-2012, 16:21
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: What is the point of timer.delay?

Quote:
Originally Posted by wireties View Post
That is really close. VxWorks has the following task states: executing, ready, blocked, delayed or any of these things in combination with suspended or stopped. I suspect the delay method simply puts the task into a delayed state. The "busy waiting" thing is not done by the OS. I think ether is referring to something commonly called a spinlock - that could be the case with this delay method but it is nothing to do with the OS.
I guess I could have been clearer. None of my comments were referring to the OS. Here's an expanded clumsy-reading version of my post, with nothing left to the reader's imagination:

If the delay is implemented as blocked waiting (used generically here to include blocked waiting for a timer) (rather than busy waiting aka "spinning", either by the programmer or by a call to an intrinsic function of the language that the programmer is using or by a library routine that the programmer calls either directly or indirectly) it halts only the thread in which it is located. Other threads continue to execute. Even if the delay is implemented (see previous exansion of "implemented") as busy waiting (aka "spinning"), other threads will execute IF they are of greater priority, or if they are of equal priority AND time-slicing is enabled.



Last edited by Ether : 18-02-2012 at 16:26.
Reply With Quote