All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] How to avoid a tight real time loop
@ 2010-06-15 12:30 Daniele Nicolodi
  2010-06-15 12:46 ` Gilles Chanteperdrix
  2010-06-15 22:11 ` Alexis Berlemont
  0 siblings, 2 replies; 6+ messages in thread
From: Daniele Nicolodi @ 2010-06-15 12:30 UTC (permalink / raw)
  To: xenomai

Hello. In my application I need to read data from an ADC card in blocks
of a given number of samples. For efficiency I'm using an mmapped buffer
to exchange data with the ADC driver. I'm setting up the acquisition,
and then calling a loop like this:

unsigned int required = <compute required number of bytes>;
unsigned int read = 0;
while (1) {
  while (read < required) {
    read = a4l_pool(...);
  }
  process(buffer, ...);
}

However if I run this loop in a real time thread the tight while loop is
an obvious cpu hog: the watchdog kicks in and kills the thread.

There is not an analogy API that can be used to require a certain amount
of data to the ADC driver. How can I code this loop to let other
processes to run?

Thanks. Cheers,
-- 
Daniele


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-06-24 22:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-15 12:30 [Xenomai-help] How to avoid a tight real time loop Daniele Nicolodi
2010-06-15 12:46 ` Gilles Chanteperdrix
2010-06-15 22:11 ` Alexis Berlemont
2010-06-16 16:49   ` Daniele Nicolodi
2010-06-16 18:19   ` Gilles Chanteperdrix
2010-06-24 22:50     ` Alexis Berlemont

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.