[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

irregular scheduling




How do I schedule a task on a totally irregular basis?
(I.e. a task setting a D/A-Converter at a certain time to a specified
value.)

I know that I can schedule it in oneshot mode by pthread_make_periodic_np.

Do multiple one-shot calls to the same task cancel each other out or are
they stacked? If many one-shots can be waited for at the same time, how
many may I start in parallel? 
Is there a way to cancel a shot?

What will happen, if a task is oneshot-scheduled for a starting-time which
lies in the past (i.e. because betrween gethrtime() and
pthread_make_periodic_np another task is run?). Will this shot get ignored
or is the task scheduled as soon as possible?

Also I have to sample some data via an D/A-Converter. Unfortunally the card
will not generate an IRQ upon having finished conversion. So I thought of
periodically starting the Conversion. The Conversion will take up to
1.2 us, then a EndOfConversion-Flag is set on some IO-Port. Should I better
do a blocking poll for the EOC-Flag  in the thread (blocking the whole
System for that time) or would it be better to have another periodic task
which looks periodically whether the conversion has finished?
Any other solutions?

-- 
jappel@linux01.gwdg.de
PGP key: http://www.math.uni-goettingen.de/appel/jappel.pgp