[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problems with RT-IPC timed services?
- To: rtl@rtlinux.org
- Subject: Problems with RT-IPC timed services?
- From: Philippe Gerum <rpm@axlog.fr>
- Date: Sat, 19 Aug 2000 12:34:05 +0200 (CEST)
Hi all,
I'm using Jerry Epplin's RT-IPC package from a stock rtlinux-2.3pre3
distro on an Intel box, and I have a strange behavior with timed
services, like rt_mq_receive() and rt_sem_wait(). In fact, these
services do not wait for the amount of time expected but immediately
return instead with a -ETIME status.
The code shows that rt_task_delay() is called internally by the timed
services to provide the needed wait. Cross-checking rt_task_delay()
with RTL's native usleep() routine, I found that the current thread is
not marked for suspension in the former. Applying the following change
(at least) seems to fix the problem:
int rt_task_delay(RTIME duration)
{
int ret = 0;
int flags;
rtl_critical(flags);
/* mark the task as delayed */
pthread_self()->resume_time = HRT_FROM_8254(duration);
pthread_self()->period = 0;
++ RTL_MARK_SUSPENDED(pthread_self());
set_bit (RTL_THREAD_TIMERARMED, &pthread_self() -> threadflags);
/* set the time at which execution may resume */
rtl_schedule();
rtl_end_critical(flags);
return ret;
}
Can somebody tell me if I'm right or wrong please, so I can stop
banging my head against my office's walls ? 8o) Sorry if this is a
beaten issue, but I found no reference in the mail archives.
PS: The IPC package from a stock rtlinux-3.0pre6e is also concerned.
Cheers,
Philippe.
--
Philippe Gerum http://www.realiant.com/ rpm@realiant.com
19-21 rue du 8 Mai 1945 http://www.carbonkernel.org/ rpm@carbonkernel.org
94110 Arcueil, France Tel: 33 1 41 24 31 10