usleep in uClibc - 0.9.27

Alessio.MASSARO at oxinst.co.uk Alessio.MASSARO at oxinst.co.uk
Tue Apr 25 10:53:14 UTC 2006


I had to use Ingo's real-time patch to get that kind of thread wake-up
latency on a vanilla kernel.
http://people.redhat.com/mingo/realtime-preempt/
and I still get rare delays up to ~300us on an EPIA board with a VIA C3
(non-Nehemiah) when I stress the ethernet i/f.

Does uclinux actually do real-time "out of the box"?!


> -----Original Message-----
> From: uclibc-bounces at uclibc.org 
> [mailto:uclibc-bounces at uclibc.org] On Behalf Of Nitish Arya
> Sent: 25 April 2006 10:46
> To: Sonia
> Cc: uclibc at uclibc.org
> Subject: Re: usleep in uClibc - 0.9.27
> 
> Hi Sonia,
>   I am using same kernel and uClibc version, and usleep does 
> work correctly. You may try using 
> timer_create(CLOCK_REALTIME), timer_settime rather than 
> setitimer as it seems to work fine and has a ns resolution.
> Also, it is better to use a auto-reloading timer for such 
> tasks than using a thread, if the code to be executed is not 
> very time-consuming, otherwise, context switch when timer 
> expires (sort of scheduler).
> regards,
> nitish
> 
> On Tue, 2006-04-25 at 10:42 +0200, Sonia wrote:
> > Hi all,
> > 
> > I'm using uClinux 2.6.12 with uClibc - 0.9.27. I'm in the work of 
> > porting my application from kernel 2.4 to kernel 2.6. I'm using the 
> > toolchain m68k-elf-tools-20031003.sh
> > 
> > The application is multithreaded, and the threads are synchronized 
> > using usleep() to make the thread stops and let the other 
> threads run.
> > 
> > With kernel 2.4 it worked fine, and we succeeded in giving 
> priority to 
> > one "real - time" thread that had to send a message every 100 ms, 
> > using usleep.
> > 
> > The problem comes with kernel 2.6. It seems that usleep function 
> > doesn't work properly. If I put:
> > 
> > usleep(1000);
> > 
> > and look with an osciloscope (using leds or digital outputs on the 
> > board), I find out that the thread sleeps for 10 ms, not 
> the expected 
> > 1 ms.
> > 
> > >From other hand, if I set up a timer, with
> > setitimer(), if the period is 50 ms I get 70 ms.
> > 
> > Has somebody found the same behaviour??
> > 
> > Thanks in advance,
> > 
> > Best regards,
> > 
> > Sonia
> > 
> >   
> > 
> > 
> > 		
> > ______________________________________________
> > LLama Gratis a cualquier PC del Mundo. 
> > Llamadas a fijos y móviles desde 1 céntimo por minuto. 
> > http://es.voice.yahoo.com
> > _______________________________________________
> > uClibc mailing list
> > uClibc at uclibc.org
> > http://busybox.net/cgi-bin/mailman/listinfo/uclibc
> 
> _______________________________________________
> uClibc mailing list
> uClibc at uclibc.org
> http://busybox.net/cgi-bin/mailman/listinfo/uclibc
> 
> +++ Virus-scanned by Messagelabs for Oxford Instruments +++
> 

 ###  OXFORD INSTRUMENTS   http://www.oxford-instruments.com/  ### 

Unless stated above to be non-confidential, this E-mail and any 
attachments are private and confidential and are for the addressee 
only and may not be used, copied or disclosed save to the addressee.
If you have received this E-mail in error please notify us upon receipt 
and delete it from your records. Internet communications are not secure 
and Oxford Instruments is not responsible for their abuse by third 
parties nor for any alteration or corruption in transmission. 




More information about the uClibc mailing list