Newbie question : Periodic executing a task

Newbie question : Periodic executing a task

Post by Sagaert Joha » Wed, 17 Mar 2004 09:04:21



Does the standard linux version offer an api to create  a thread that
executes on a periodic basis (eg every 10ms )
or do i need RTlinux for that ?

Johan

 
 
 

Newbie question : Periodic executing a task

Post by Michael Schnel » Wed, 17 Mar 2004 17:52:03


Quote:> Does the standard linux version offer an api to create  a thread that
> executes on a periodic basis (eg every 10ms )
> or do i need RTlinux for that ?

1) Why would you want to do that ?  waking up a sleeping thread every
10ms that does it's thing and cycles back to go sleeping again seems
more appropriate.

2) Linux can't _guarantee_ 10 mSek timing. You may see a latency of

Quote:>100mSek (dropping e.g. 10 cycles) now and then (e.g. if some other task does IDE activity). So if this is critical you need RT/Linux (or RAT which I found more recommended in the near past).

-Michael

 
 
 

Newbie question : Periodic executing a task

Post by Jürgen Quereng?sse » Thu, 18 Mar 2004 23:34:09



Quote:> Does the standard linux version offer an api to create  a thread that
> executes on a periodic basis (eg every 10ms )
> or do i need RTlinux for that ?

> Johan

Hi Johan,
the kernel sources contain the file ../Documentation/rtc.txt. It describes,
how to realise your task.

Juergen

 
 
 

1. HOW TO build a periodic task?

Hello everybody!!

I am trying to implement a periodic launching facility inside Linux
1.2.13, but I cannot get it working!!

To make things shorter, I build a list of periodic tasks in the state
TASK_UNINTERRUPTIBLE. Each task has a period of activation, and the list
is sorted by that time. Periodically the 8254 issues an interrupt and
puts the state of the first task in the list to TASK_RUNNING
(need_resched is set to 1, as well), and reinserts it into the list with
a complete period.

I have also modified the exit system call so that the IP is reset to the
start address and the task state turned to the TASK_UNINTERRUPTIBLE
state again. I'm working with a.out files because I'm not familiar with
ELF format, and I get the start IP address from the field ex.a_entry
used in the function load_aout_binary().

A task with such modifications should run periodically, but it never
runs, not once. I think it could be because apart from resetting the IP
something else is needed to leave a task in its initial state. I'm quite
sure the tasks are selected by the scheduler and an explicit switch_to()
is made, but it won't work at any rate.

Please could you help me ASAP?? I'm really despaired!!

Thanks in advance, CARLOS AKA SLACKER

2. Problems with ne2000 pci cards

3. Periodic tasks in real-time once again

4. Best Motherboard for Linux with Pentium?

5. how to make tasks periodic ?

6. how to unzip .Z files

7. Please Explain Simple Error Msg

8. execute specific task if system is going to reboot

9. newbie question (cgi execute)

10. Newbie Question: execute .bin file

11. Newbie compile / execute question

12. Task States; can't kill 'D' tasks