Re: [LAD] easiest way to serialize messages for sending over a ringbuffer?

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Nick Copeland <nickycopeland@...>
Cc: <linux-audio-dev@...>
Date: Wednesday, December 14, 2011 - 7:37 pm

--20cf3040e370a9278d04b41280d6
Content-Type: text/plain; charset=ISO-8859-1

> > Thanks for the tips. What should one do if one detects a partial

Thanks Nick, so if I understand what you're saying, the producer should
check for sizeof(MyStruct) space before writing, and just delay writing
that message if there isn't enough space. I guess that's where I would log
that there a write failed then?

thanks
iain

--20cf3040e370a9278d04b41280d6
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

> Thanks for the tips. What should one do if=
one detects a partial write? Is it best to have integrity checks on both e=
nds of the ringbuffer?Avoid them.=A0 There should be some cal=
ls for checkRingBufferWriteSpace(), make sure it is large enough to cater f=
or your object size. You still have a few hoops and jumps to go through if =
the buffer is filling up but it is definitely going to be easier that cater=
ing for partial writes. Consider also logging messages when it is full and =
if it happens (too much or in my opinion at all) then look into why the rea=
der is going too slow. If it is a general issue then you need to rearchitec=
t what you are doing, if it is just a transient issue then bang more capaci=
ty on the ringbuffer.
Thanks Nick, so if=
I understand what you're saying, the producer should check for sizeof(=
MyStruct) space before writing, and just delay writing that message if ther=
e isn't enough space. I guess that's where I would log that there a=
write failed then?
thanksiain

--20cf3040e370a9278d04b41280d6--

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [LAD] easiest way to serialize messages for sending over..., Iain Duncan, (Wed Dec 14, 7:37 pm)