Page 1 of 1

Problem with two tasks (threads)

Posted: Thu Mar 12, 2015 4:44 am
by dmdeangelo
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.

Re: Problem with two tasks (threads)

Posted: Thu Mar 12, 2015 12:00 pm
by e.guidieri
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

Re: Problem with two tasks (threads)

Posted: Thu Mar 12, 2015 4:32 pm
by dmdeangelo
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.

Re: Problem with two tasks (threads)

Posted: Thu Mar 12, 2015 5:00 pm
by e.guidieri
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.

Re: Problem with two tasks (threads)

Posted: Thu Mar 12, 2015 7:28 pm
by dmdeangelo
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?

Re: Problem with two tasks (threads)

Posted: Fri Mar 13, 2015 10:57 am
by e.guidieri
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.

Re: Problem with two tasks (threads)

Posted: Fri Mar 13, 2015 1:09 pm
by paolo.gai
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

Re: Problem with two tasks (threads)

Posted: Sun Mar 22, 2015 8:14 pm
by dmdeangelo
Right.

Thanks for the help, guys.