Page 2 of 2

Re: need advice to implement blocking ring buffer

Posted: Tue Oct 02, 2018 10:00 am
by Giovanni
... there are still problems, I need to rethink the approach.

Giovanni

Re: need advice to implement blocking ring buffer

Posted: Wed Oct 03, 2018 12:45 pm
by alex31
... 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

Posted: Wed Oct 03, 2018 1:13 pm
by alex31
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.

Re: need advice to implement blocking ring buffer

Posted: Wed Oct 03, 2018 2:05 pm
by Giovanni
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