Hi Thomas,
Have a look at the man pages of both, you will know the difference.
To solve the problem, all you need to do is call rtl_schedule immediately
after pthread_suspend_np.
Regards
Santhosh
-----Original Message-----
From: Thomas Held [SMTP:[EMAIL PROTECTED]]
Sent: Monday, April 17, 2000 12:37 AM
To: [EMAIL PROTECTED]
Subject: [rtl] rt_task_suspend and pthread_suspend_np
Hello,
there seems to be a difference between
rt_task_suspend and pthread_suspend_np
My task is not working any more with Version V2.0 for Linux 2.2.13.
I have a programm for AD conversion for RTLinux.
One periodic task (every 30 s) triggers the conversion task (250?s) running 15 times
and then suspends itself for the next trigger.
Version V1.3 for Linux 2.0.37 worked very well but Version V2.0 for Linux 2.2.13
doesn' t stop.
Where is my mistake ? How to solve the problem?
Thanks for your help!
Here the abstract example Version V1.3 for Linux 2.0.37
void SystemTask (int FIFO) {
while (1) {
.......
}
rt_task_make_periodic(&tasks[0], rt_get_time(),250*microsec);
rt_task_wait();
}
}
void AD_Convert (int FIFO) {
while (1) {
switch (++CntConversion) {
case 1: /* Register loschen */
........
case 15:
CntConversion = 0;
break;
default:
CntConversion = 0;
}
if (CntConversion == 0) {
rt_task_suspend(&tasks[0]);
} else {
rt_task_wait();
}
}
}
Programmed for Version V2.0 for Linux 2.2.13
void *SystemTask (void *VFIFO) {
int FIFO = (int) VFIFO;
while (1) {
....
}
pthread_make_periodic_np (tasks[0], gethrtime(),250*microsec);
pthread_wait_np();
}
}
void *AD_Convert (void *VFIFO) {
while (1) {
switch (++CntConversion) {
case 1: /* Register loschen */
case 15:
CntConversion = 0;
break;
default:
CntConversion = 0;
}
if (CntConversion == 0) {
pthread_suspend_np(tasks[0]);
} else {
pthread_wait_np();
}
}
}
kind regards
Thomas Held
[EMAIL PROTECTED]
<< File: ATT00000.htm >>
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/