<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: context switching during delays</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=2>On a more philosophical note, I need to do short delays in some of my device drivers.</FONT>
</P>

<P><FONT SIZE=2>Say 1/10 of a second.</FONT>
</P>

<P><FONT SIZE=2>What is the appropriate routine to use???</FONT>
<BR><FONT SIZE=2>Should I use a busy/spin loop or should I use something that context switches???</FONT>
</P>

<P><FONT SIZE=2>sleep()</FONT>
<BR><FONT SIZE=2>nanosleep()</FONT>
<BR><FONT SIZE=2>rtems_task_wake_after()</FONT>
<BR><FONT SIZE=2>Something else???</FONT>
</P>

<P><FONT SIZE=2>Thanks,</FONT>
<BR><FONT SIZE=2>Nick</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Joel Sherrill [<A HREF="mailto:joel.sherrill@OARcorp.com">mailto:joel.sherrill@OARcorp.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, July 24, 2001 7:16 PM</FONT>
<BR><FONT SIZE=2>To: Hennenfent, Nick {AVL~Roswell}</FONT>
<BR><FONT SIZE=2>Cc: rtems-users@OARcorp.com</FONT>
<BR><FONT SIZE=2>Subject: Re: context switching during delays</FONT>
</P>

<P><FONT SIZE=2>Hello world does not configure a clock tick device driver</FONT>
<BR><FONT SIZE=2>and thus has no way to measure the passage of time. </FONT>
<BR><FONT SIZE=2>Once you do the context switch, you will end up</FONT>
<BR><FONT SIZE=2>in the idle task with no way to get out of it.</FONT>
</P>
<BR>

<P><FONT SIZE=2>--</FONT>
<BR><FONT SIZE=2>Joel Sherrill, Ph.D.             Director of Research & Development</FONT>
<BR><FONT SIZE=2>joel@OARcorp.com                 On-Line Applications Research</FONT>
<BR><FONT SIZE=2>Ask me about RTEMS: a free RTOS  Huntsville AL 35805</FONT>
<BR><FONT SIZE=2>Support Available                (256) 722-9985</FONT>
</P>

</BODY>
</HTML>