AW: [En-Nut-Discussion] Again a thread question

Harald Kipp harald.kipp at egnite.de
Wed Jun 9 14:00:45 CEST 2004


Hi Ole,

let me ask questions first.

What is the reason for giving the two threads
different priorities? Do you want to have the
higher priority thread running more often without
completely blocking the lower priority thread?

Btw. if both threads are running at the same priority
NutThreadYield() will switch the context.

Harald

At 13:29 09.06.2004 +0200, you wrote:
>Hi,
>
> > below 90 means lower priority, i.e. > 90.
> > NutThreadSetPriority (91), for example.
>
>If even works if you set it to the same priority...
>
>Robert Hildebrand just send me an answer. I'll paste it below...
>But should'nt we think about a scheduling algorithm that won't let a
>thread freeze?
>
>Bye,
>
>Ole
>
>PS: Here is the answer from Robert:
>
> > NutThreadYield() gives Nut/OS the possibility to start the thread with
>the
> > highest priority waiting to run. Your main-thread is always waiting to
> > continue when calling NutThreadYield(), but not when calling NutSleep(70).
> >
> > So every thread with higher priority should be really waiting with NutSleep
> > or reading from a stream (which blocks, when no data are available) or 
> doing
> > something similar to give lower-priority-tasks the possibility to run.
>
>--
>kernel concepts    Tel: +49-271-771091-14
>Dreisbachstr. 24   Fax: +49-271-771091-19
>D-57250 Netphen    E+ : +49-177-7420433
>--
>
>
>_______________________________________________
>En-Nut-Discussion mailing list
>En-Nut-Discussion at egnite.de
>http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list