Hello,
I'm new of Chibios/RT, sorry for my dummy question. What's the equivalent of xQueueCreate of FreeRTOS?
I know that in ChRt we have mailboxes, I/O queues, sync messages but it's not clear for me what the best choise to replace the xQueueCreate class. My need is to have queues of structs to share data between tasks/tasks and ISR/tasks.
Thanks, regards
xQueueCreate equivalent
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: xQueueCreate equivalent
Hi,
Look at "Object Queues", it is a pool of structures of the same size exchanged via a mailbox: Get a structure from the pool, send it, receive it, return it to the pool.
It can be used by ISR and tasks, fully static.
Giovanni
Look at "Object Queues", it is a pool of structures of the same size exchanged via a mailbox: Get a structure from the pool, send it, receive it, return it to the pool.
It can be used by ISR and tasks, fully static.
Giovanni
Re: xQueueCreate equivalent
Giovanni wrote:Hi,
Look at "Object Queues", it is a pool of structures of the same size exchanged via a mailbox: Get a structure from the pool, send it, receive it, return it to the pool.
It can be used by ISR and tasks, fully static.
Giovanni
Thanks for your reply. I'm not able to find info about object queues, sorry, could you give me more details/links?
Thanks
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: xQueueCreate equivalent
You can also use (abuse?) I/O Buffers Queues.
http://chibios.sourceforge.net/docs/19. ... e_r_s.html
It may even be faster than Object FIFOs. Any comments on the fastest block based queue implementation in ChibiOS Giovanni?
http://chibios.sourceforge.net/docs/19. ... e_r_s.html
It may even be faster than Object FIFOs. Any comments on the fastest block based queue implementation in ChibiOS Giovanni?
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: xQueueCreate equivalent
Those are different, ObjFIFOs are meant to exchange fixed-size structures in a copy-less way.
HAL I/O buffers are used in those situations where you have to read/write byte streams from one side and fetch/post buffers from the other side, it is more of a buffering system.
Which is better depends on the use case.
Giovanni
HAL I/O buffers are used in those situations where you have to read/write byte streams from one side and fetch/post buffers from the other side, it is more of a buffering system.
Which is better depends on the use case.
Giovanni
Re: xQueueCreate equivalent
Giovanni wrote:Those are different, ObjFIFOs are meant to exchange fixed-size structures in a copy-less way.
HAL I/O buffers are used in those situations where you have to read/write byte streams from one side and fetch/post buffers from the other side, it is more of a buffering system.
Which is better depends on the use case.
Giovanni
From the API documentation:
Buffers Queues are used when there is the need to exchange fixed-length data buffers between ISRs and threads.
It has a byte queue emulation API as well, but can certain be used for fixed length object.
Need to benchmark...
Re: xQueueCreate equivalent
Giovanni wrote:Those are different, ObjFIFOs are meant to exchange fixed-size structures in a copy-less way.
HAL I/O buffers are used in those situations where you have to read/write byte streams from one side and fetch/post buffers from the other side, it is more of a buffering system.
Which is better depends on the use case.
Giovanni
For a byte queue, what's the difference between an I/O queue, and the new pipe_t ?
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: xQueueCreate equivalent
I/O queues are asymmetric, there always is an ISR (low) side and a thread (high) side, in addition, there is a callback notification mechanism high->low. It is specialized for a specific use, serial-like drivers. This is why I/O queues are in HAL, same for buffer queues.
Pipes are generic thread to thread byte streams with no specific use.
Giovanni
Pipes are generic thread to thread byte streams with no specific use.
Giovanni
- sabdulqadir
- Posts: 49
- Joined: Fri Mar 23, 2018 7:29 pm
- Has thanked: 13 times
- Been thanked: 4 times
Re: xQueueCreate equivalent
Giovanni wrote:Those are different, ObjFIFOs are meant to exchange fixed-size structures in a copy-less way.
Giovanni
Are HAL I/O BUFFERS not copy-less too?
AQ
Who is online
Users browsing this forum: No registered users and 10 guests