I am not getting any mail from the lists. It isn't hitting our spam filter
at all. I try to re-sign up, but it says I'm already subscribed. I'm reading
replies from the archives.

As Peter said, a solution that isn't scalable is not desirable. He is
correct. I believe I have found a solution to the problem using another
priority ordered queue (with my own queuing functions) in the rt_task
structure, and with some modifications to sem.c. (I will explain in more
detail how this queue is used after much testing, but so far results look
good. It's used as a combination priority ordered queue and linked list.)

However, I found another problem with the semaphore implementation in the
course of this work.

Suppose I have a task like this:

for(;;) {
    rt_sem_wait(&sem);
    stuff();
    rt_sem_signal();
    rt_task_wait_period();
}

If the task period elapsed already waiting for the sem,
rt_task_wait_period() will return immediately. Suppose that a lower priority
task was waiting on this sem while this one was using it. It was put back on
the ready queue by rt_sem_signal(), but this tasks' immediate call to
rt_sem_wait() will block because the sem's count is <= 0 due to the other
wait. Thus, the lower priority task will then get the free semaphore and the
higher priority one will wait! There was also a simple solution to this
problem as well.

Steven


Reply via email to