This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: System timer resolution and TCP/IP package


On Fri, Jan 25, 2002 at 03:47:42PM +0100, Martin Buck wrote:
> Jurica Baricevic wrote:
> > cyg_thread_delay(1) seems fine.
> 
> Completely unrelated to your questions, but cyg_thread_delay(1) reminds
> me of something I always wanted to ask:
> 
> How long does cyg_thread_delay(1) wait, assuming a 10ms tick? 0-10ms or
> 10-20ms?
> 
> If it's 0-10ms, then it's pretty dangerous to use, because you usually
> mean[1] "some short delay in the order of a few ms", but you could just
> as well get no delay at all, if the next timer interrupt happens to
> arrive right after the call to cyg_thread_delay().

When I do it, it's always in a loop semi-busy-waiting for an event:

  while (waiting_for_guffman)
      cyg_thread_delay(1);

The first dealy is 0-10ms, but (assuming the system isn't
completely swamped) subsequent delays are 10ms each.

-- 
Grant Edwards
grante@visi.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]