Quantcast
Channel: C6000™多核 - 最近的话题
Viewing all articles
Browse latest Browse all 5545

通过信号量来调度任务的问题

$
0
0

各位好,这里有个问题想请教下大家。

是这样的,在工程中创建了3个任务,任务的执行顺序是通过信号量来控制的。

大致框架如下:

void tskFxn0()
{
    for(;;)
    {
         ...
         Semaphore_post(sem_fxn1);
         ...
    }
}

void tskFxn1()
{
    for(;;)
    {
         ...
         Semaphore_pend(sem_fxn1, BIOS_WAIT_FOREVER);
         ...
         Semaphore_post(sem_fxn2);
         ...
    }
}

void tskFxn2()
{
    for(;;)
    {
         ...
         Semaphore_pend(sem_fxn2, BIOS_WAIT_FOREVER);
         ...
    }
}

其中tskFxn0优先级最低,其他两个任务优先级一样。

问题就是:程序会一直在tskFxn0中,一直post信号,其他任务不能得到信号


Viewing all articles
Browse latest Browse all 5545