... there are still problems, I need to rethink the approach.
Giovanni
need advice to implement blocking ring buffer
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: need advice to implement blocking ring buffer
... there are still problems, I need to rethink the approach.
I just connect to the forum to say that it was working for me now, but apparently, not completely ...
what kind of problems have you detected with the present code ?
Alexandre
Re: need advice to implement blocking ring buffer
Only problem that i see for now is a performance problem, using 32 bytes buffers, random length read write, i bench 250kb/s witch chPipes, and 350 kb/s with mine on stm32f4 (-O0, -g) , otherwise, seems to work.
- Giovanni
- Site Admin
- Posts: 14895
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 997 times
Re: need advice to implement blocking ring buffer
Hi,
I already made changes, you probably tested the latest code which corrected the problem I mentioned.
It still requires better tests, good to know it is working on your side anyway.
Performance may benefit from a larger buffer, it is mostly memcpy() anyway. It could improve by using critical zones instead of mutexes but that would have other undesirable side effects.
Giovanni
I already made changes, you probably tested the latest code which corrected the problem I mentioned.
It still requires better tests, good to know it is working on your side anyway.
Performance may benefit from a larger buffer, it is mostly memcpy() anyway. It could improve by using critical zones instead of mutexes but that would have other undesirable side effects.
Giovanni