Hello.
I'm using ChibiOS 2.6.6. on STM32F4.
Is there a reason to restrict the block access to IO queues from both directions? As I see, Input queues are block accessible from the output only. And the opposite - output queues are block accessible from the input only. I understand that such a implementation fits perfectly on low level drivers like UART, where the low side is byte sized. But there is a cases when the low side also has a block of bytes structure. In this case it will be good if we have block access from both side of queue. Typically such a need exist when two thread are connected on both sides of queue. Of course the block R/W operations needs to be atomic (protected) but it's not an usual case.
Did I miss something, or these is a special reason to restrict block access from both sides of queues?
IO Queue question?
Moderators: RoccoMarco, lbednarz, tfAteba
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: IO Queue question?
Hi,
Those queues are meant to link an ISR to a Thread, the ISR side cannot be blocking by definition this is why I/O queues are asymmetrical.
If you need a queue between two threads then mailboxes are a better choice.
Giovanni
Those queues are meant to link an ISR to a Thread, the ISR side cannot be blocking by definition this is why I/O queues are asymmetrical.
If you need a queue between two threads then mailboxes are a better choice.
Giovanni
Re: IO Queue question?
I understand.
Yes, mailbox is an option, but generally it is heavier and with more complicate usage. Generally I need a simple FIFO with thread safe functionality.
I think for an option to use an existing queue structures and to create a custom wrapper around them.
Yes, mailbox is an option, but generally it is heavier and with more complicate usage. Generally I need a simple FIFO with thread safe functionality.
I think for an option to use an existing queue structures and to create a custom wrapper around them.