Problem with two tasks (threads)

Forum related to ERIKA Enterprise and RT-Druid version 2

Moderator: paolo.gai

Post Reply
dmdeangelo
Newbie
Posts: 4
Joined: Wed Mar 11, 2015 4:59 pm

Problem with two tasks (threads)

Post by dmdeangelo » Thu Mar 12, 2015 4:44 am

Hello.
I'm having great difficulties to build a model with two competing tasks for ATmega328P.

I tried to use Eclipse on windows, but appears many errors.
I tried to use the available virtual machine, but also appears many errors.

Is there a chronic problem with the distribution?
Can anyone help me find a solution?

Thanks.

e.guidieri
Full Member
Posts: 166
Joined: Tue May 10, 2011 2:05 pm

Re: Problem with two tasks (threads)

Post by e.guidieri » Thu Mar 12, 2015 12:00 pm

The errors you are seeing are related to the Eclipse's internal parser.

Did you tried to build the project?

Because the build process generate some informations used by eclipse, this won't fix all the errors that the parser belive to see, but a lot of them yes.

The only errors you can rely on are those that appears AFTER a build, you can check those i "console view" and "error view".

Bye

dmdeangelo
Newbie
Posts: 4
Joined: Wed Mar 11, 2015 4:59 pm

Re: Problem with two tasks (threads)

Post by dmdeangelo » Thu Mar 12, 2015 4:32 pm

Hello Guidieri.

The version I downloaded has only one model for ATmega328, Blink.
He compiled and worked properly.

But I need multiple tasks (3 or 4, maybe more) running in parallel, can not use timers, I need threads as on a computer.
And from that model (Blink) parallelism did not work.
Appears many errors at compile time.

Can you help me get a model for multiple concurrent tasks?
I use ATmega328.

e.guidieri
Full Member
Posts: 166
Joined: Tue May 10, 2011 2:05 pm

Re: Problem with two tasks (threads)

Post by e.guidieri » Thu Mar 12, 2015 5:00 pm

Erika is not a Round Robin Scheduler, so you cannot have thread has they are on PC.

Moreover you cannot have a Round Robin Scheduler (any preemptive scheduler at all, to be correct), without using Interrupts. So I think you should understand better your requirements.

dmdeangelo
Newbie
Posts: 4
Joined: Wed Mar 11, 2015 4:59 pm

Re: Problem with two tasks (threads)

Post by dmdeangelo » Thu Mar 12, 2015 7:28 pm

I can have a scheduler based on timers (like the Roudin Robin).
But often I will not be able to complete the task in a given time, I need a feature that makes the exchange of context simply stopping the current task and resuming it from the same point without restart.

Erika offers me?
Is there any other resource that offers me something?

e.guidieri
Full Member
Posts: 166
Joined: Tue May 10, 2011 2:05 pm

Re: Problem with two tasks (threads)

Post by e.guidieri » Fri Mar 13, 2015 10:57 am

I could suggest you some solutions, but before to understand what you need to do. For example this
I can have a scheduler based on timers (like the Roudin Robin).
But often I will not be able to complete the task in a given time,...
for doesn't mean nothing to me.

paolo.gai
Administrator
Posts: 875
Joined: Thu Dec 07, 2006 12:11 pm

Re: Problem with two tasks (threads)

Post by paolo.gai » Fri Mar 13, 2015 1:09 pm

Hi,

ERIKA offers a priority based scheduler, and not a Round-Robin scheduler.

You can get something slightly similar to round robin on the FRSH kernel, but it is not supported on the ATMega.

Ciao,

Paolo

dmdeangelo
Newbie
Posts: 4
Joined: Wed Mar 11, 2015 4:59 pm

Re: Problem with two tasks (threads)

Post by dmdeangelo » Sun Mar 22, 2015 8:14 pm

Right.

Thanks for the help, guys.

Post Reply