EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

What means of word 'quesue' in this RTOS description?

Started by Robert Willy July 24, 2015
Tim Wescott wrote:
> On Fri, 24 Jul 2015 20:52:51 -0500, Les Cargill wrote: > >> Tim Wescott wrote: >>> On Fri, 24 Jul 2015 04:12:23 -0700, Robert Willy wrote: >>> >>>> Hi, >>>> >>>> I read an online tutorial on RTOS, see below dot line please. >>>> I am not clear about what is for the word 'queue' in the first line. >>>> Does it mean a task queue? >>>> >>>> >>>> Thanks in advance. >>>> .................... >>>> The use of a queue allows the medium priority task to block until an >>>> event causes data to be available - and then immediately jump to the >>>> relevant >>>> function to handle the event. This prevents wasted processor cycles >>>> - >>>> in contrast to the infinite loop implementation whereby an event >>>> will only be processed once the loop cycles to the appropriate >>>> handler. >>> >>> I'm not sure what you mean by "task queue". >>> >>> Generally, RTOS implementations don't bind a queue to any specific >>> task. Rather, the developer does so: anything can put messages into a >>> queue, anything can take messages off of a queue, and anything can pend >>> on a queue. If the developer is wise, only one task takes things off >>> the queue, and there is a well-defined, small number (one is best) of >>> sources that put things on the queue. >>> >>> You arrange things so that the task that depends on the queue needs to >>> run if and only if there's a message on the queue, and you have the >>> task pend on the queue having a message available. >>> >>> >> One common method of referring to task/thread eligibility to run is to >> have a "ready queue" or a "waiting queue". This may not actually be a >> queue; it can be nothing more than a state in the set of task control >> blocks. >> >> Vhttp://www.qnx.com/developers/docs/660/index.jsp?topic=% > 2Fcom.qnx.doc.neutrino.prog%2Ftopic%2Foverview_Ready_queue.html > > That's not what the OP is talking about,
Then I have no hope of finding what he's talking about. 1) "The use of a queue allows the medium priority task to block until an event causes data to be available" - mention of blocking, which is very much a "waiting queue"/"ready queue" sort of thing, although you have to wonder why medium priority matters. The big ambiguity is whether or not the queue is a data source/buffer or simply a wait/block structure. 2) The compare/contrast with The Big Loop. wait/ready queuing is as close as I can get with that mess. > but yes, I had forgotten that
> terminology (please, please do not ask me why). >
:) -- Les Cargill
On 7/26/2015 7:27 AM, Les Cargill wrote:
> Tim Wescott wrote: >> On Fri, 24 Jul 2015 20:52:51 -0500, Les Cargill wrote: >> >>> Tim Wescott wrote: >>>> On Fri, 24 Jul 2015 04:12:23 -0700, Robert Willy wrote: >>>> >>>>> Hi, >>>>> >>>>> I read an online tutorial on RTOS, see below dot line please. >>>>> I am not clear about what is for the word 'queue' in the first line. >>>>> Does it mean a task queue? >>>>> >>>>> >>>>> Thanks in advance. >>>>> .................... >>>>> The use of a queue allows the medium priority task to block until an >>>>> event causes data to be available - and then immediately jump to the >>>>> relevant >>>>> function to handle the event. This prevents wasted processor cycles >>>>> - >>>>> in contrast to the infinite loop implementation whereby an event >>>>> will only be processed once the loop cycles to the appropriate >>>>> handler. >>>> >>>> I'm not sure what you mean by "task queue". >>>> >>>> Generally, RTOS implementations don't bind a queue to any specific >>>> task. Rather, the developer does so: anything can put messages into a >>>> queue, anything can take messages off of a queue, and anything can pend >>>> on a queue. If the developer is wise, only one task takes things off >>>> the queue, and there is a well-defined, small number (one is best) of >>>> sources that put things on the queue. >>>> >>>> You arrange things so that the task that depends on the queue needs to >>>> run if and only if there's a message on the queue, and you have the >>>> task pend on the queue having a message available. >>>> >>>> >>> One common method of referring to task/thread eligibility to run is to >>> have a "ready queue" or a "waiting queue". This may not actually be a >>> queue; it can be nothing more than a state in the set of task control >>> blocks. >>> >>> Vhttp://www.qnx.com/developers/docs/660/index.jsp?topic=% >> 2Fcom.qnx.doc.neutrino.prog%2Ftopic%2Foverview_Ready_queue.html >> >> That's not what the OP is talking about, > > Then I have no hope of finding what he's talking about.
The OP mistakenly called it a "task queue". It's actually a "data FIFO" supported as a first-class object by the OS. As such, a *task* can pend on it "efficiently" (moreso than spinning on it!)
> 1) "The use of a queue allows the medium priority task to block until > an event causes data to be available" - mention of blocking, which is > very much a "waiting queue"/"ready queue" sort of thing, although > you have to wonder why medium priority matters.
Read the cited example.
> The big ambiguity is whether or not the queue is a data source/buffer > or simply a wait/block structure. > > 2) The compare/contrast with The Big Loop. > > wait/ready queuing is as close as I can get with that mess.
Read the examples *preceding* the cited example. :>
> > but yes, I had forgotten that >> terminology (please, please do not ask me why). >> > > :) >
On Sun, 26 Jul 2015 09:27:27 -0500, Les Cargill wrote:

> Tim Wescott wrote: >> On Fri, 24 Jul 2015 20:52:51 -0500, Les Cargill wrote: >> >>> Tim Wescott wrote: >>>> On Fri, 24 Jul 2015 04:12:23 -0700, Robert Willy wrote: >>>> >>>>> Hi, >>>>> >>>>> I read an online tutorial on RTOS, see below dot line please. >>>>> I am not clear about what is for the word 'queue' in the first line. >>>>> Does it mean a task queue? >>>>> >>>>> >>>>> Thanks in advance. >>>>> .................... >>>>> The use of a queue allows the medium priority task to block until an >>>>> event causes data to be available - and then immediately jump to the >>>>> relevant >>>>> function to handle the event. This prevents wasted processor >>>>> cycles - >>>>> in contrast to the infinite loop implementation whereby an event >>>>> will only be processed once the loop cycles to the appropriate >>>>> handler. >>>> >>>> I'm not sure what you mean by "task queue". >>>> >>>> Generally, RTOS implementations don't bind a queue to any specific >>>> task. Rather, the developer does so: anything can put messages into a >>>> queue, anything can take messages off of a queue, and anything can >>>> pend on a queue. If the developer is wise, only one task takes >>>> things off the queue, and there is a well-defined, small number (one >>>> is best) of sources that put things on the queue. >>>> >>>> You arrange things so that the task that depends on the queue needs >>>> to run if and only if there's a message on the queue, and you have >>>> the task pend on the queue having a message available. >>>> >>>> >>> One common method of referring to task/thread eligibility to run is to >>> have a "ready queue" or a "waiting queue". This may not actually be a >>> queue; it can be nothing more than a state in the set of task control >>> blocks. >>> >>> Vhttp://www.qnx.com/developers/docs/660/index.jsp?topic=% >> 2Fcom.qnx.doc.neutrino.prog%2Ftopic%2Foverview_Ready_queue.html >> >> That's not what the OP is talking about, > > > Then I have no hope of finding what he's talking about. > > 1) "The use of a queue allows the medium priority task to block until an > event causes data to be available" - mention of blocking, which is very > much a "waiting queue"/"ready queue" sort of thing, although you have to > wonder why medium priority matters. > > The big ambiguity is whether or not the queue is a data source/buffer or > simply a wait/block structure. > > 2) The compare/contrast with The Big Loop. > > wait/ready queuing is as close as I can get with that mess.
The OP refers to it in another sub-thread: it's the FreeRTOS "queue" entity, which is a typical RTOS queue that you stuff messages into from a source, and block on pending message availability in some task. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com

The 2024 Embedded Online Conference