N
Hi,
I need that some procedures be executed in an
exact time and in a periodic manner. That is,
for example a buffer must be copied for each 200
microseconds elapsed. The execution time of the
procedure shall not be delayed even for a 10
microseconds. I mean that the task must be
performed exactly in the clock tick. So What I
need is a very exact timing mechanism in Linux.
I tried some approaches to meet the above requirement.
I modified the real time clock device driver
(/usr/src/linux/drivers/char/rtc.c) by adding some
code to rtc_interrupt() routine. This code intends to inform a user process to perform the desired task via sending a signal to it. But the user process does not immediately receive the signal because the signal is queued and would be delivered until the next time that the process is scheduled and take the CPU. This delay to receive signal is my problem.
To solve it, I save the "current" pointer in rtc_open() routine in a variable called MAC, and then in rtc_interrupt() routine, I change the value of "MAC->state" field to TASK_RUNNING and then call schedule() to wake up my desired task. But when I run my process, computer hangs up and must be restarted manually. Should I use RTLinux instead of Linux ???...
I look forward to hear from you soon.
Thanks for your valuable hints and assistance,
Best regards,
Nader Ghasemi
Sep 17,2001
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
I need that some procedures be executed in an
exact time and in a periodic manner. That is,
for example a buffer must be copied for each 200
microseconds elapsed. The execution time of the
procedure shall not be delayed even for a 10
microseconds. I mean that the task must be
performed exactly in the clock tick. So What I
need is a very exact timing mechanism in Linux.
I tried some approaches to meet the above requirement.
I modified the real time clock device driver
(/usr/src/linux/drivers/char/rtc.c) by adding some
code to rtc_interrupt() routine. This code intends to inform a user process to perform the desired task via sending a signal to it. But the user process does not immediately receive the signal because the signal is queued and would be delivered until the next time that the process is scheduled and take the CPU. This delay to receive signal is my problem.
To solve it, I save the "current" pointer in rtc_open() routine in a variable called MAC, and then in rtc_interrupt() routine, I change the value of "MAC->state" field to TASK_RUNNING and then call schedule() to wake up my desired task. But when I run my process, computer hangs up and must be restarted manually. Should I use RTLinux instead of Linux ???...
I look forward to hear from you soon.
Thanks for your valuable hints and assistance,
Best regards,
Nader Ghasemi
Sep 17,2001
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc