Page 1 of 1

two infinite loops task on one core in tricore

Posted: Thu Jun 13, 2019 10:10 am
by Yuriy
Hello,

Does it possible create two infinite loops task on one core? I red about extended tasks in Erika V3.

Could you give me example OIL.

Thank you.

Re: two infinite loops task on one core in tricore

Posted: Thu Jun 13, 2019 11:11 am
by paolo.gai
There are various event demos in the templates available in the standard distribution. just instantiate one of them...

Ciao,

PJ

Re: two infinite loops task on one core in tricore

Posted: Fri Jun 14, 2019 8:17 am
by Yuriy
Thank you for fast answer.

But in examples i can't use infinite loops, i should use WaitEvent and wait event.


I need something like that.

Code: Select all

TASK(Producer)
{
	for (;;){}
}

TASK(Consumer)
{
    for (;;){}
}

Code: Select all


    TASK Consumer {
        PRIORITY = 2;
        ACTIVATION = 1;
        STACK = PRIVATE {
            SYS_SIZE = 256;
        };
        AUTOSTART   = TRUE;
        SCHEDULE = NON;
        EVENT = ProducerEvent;
    };

    TASK Producer {
        PRIORITY = 3;
        ACTIVATION = 1;
        STACK = PRIVATE {
            SYS_SIZE = 256;
        };
        AUTOSTART   = TRUE;
        SCHEDULE    = NON;
        EVENT       = ConsumerEvent;
    };

but it doesn't work. Execution only Producer. it looks like green threads https://en.wikipedia.org/wiki/Green_threads
When a green thread executes a blocking system call, not only is that thread blocked, but all of the threads within the process are blocked
Can you help me?

Re: two infinite loops task on one core in tricore

Posted: Fri Jun 14, 2019 10:54 am
by paolo.gai
ERIKA is an AUTOSAR OS. Please check the specification, the scheduling is priority driven, with immediate priority ceiling. No Round Robin.

Ciao,

PJ