need advice to implement blocking ring buffer

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, utzig, tfAteba, barthess

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: need advice to implement blocking ring buffer

Postby Giovanni » Tue Oct 02, 2018 10:00 am

... there are still problems, I need to rethink the approach.

Giovanni

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: need advice to implement blocking ring buffer

Postby alex31 » Wed Oct 03, 2018 12:45 pm

... 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

User avatar
alex31
Posts: 374
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 38 times
Been thanked: 61 times
Contact:

Re: need advice to implement blocking ring buffer

Postby alex31 » Wed Oct 03, 2018 1:13 pm

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.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: need advice to implement blocking ring buffer

Postby Giovanni » Wed Oct 03, 2018 2:05 pm

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


Return to “General Support”

Who is online

Users browsing this forum: No registered users and 10 guests