&msg--20cf303dd31202caba04b4056454
Content-Type: text/plain; charset=ISO-8859-1> My DataMessage structure is just a simple C structure for now. Is there a
as long as the struct is POD (Plain Old Data - no embedded pointers,
Thanks for the tips. What should one do if one detects a partial write? Is
it best to have integrity checks on both ends of the ringbuffer?
the jack ringbuffer design is particular bad in this respect because
Does this mean a good way to initialize it is to make the ringbuffer some
multiple of the sizeof(myMessageStruct) plus one byte?
Thanks again for all the help.
iain
--20cf303dd31202caba04b4056454
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
> My DataMessage structure is just a simple C structure for now. Is ther=
e a
as long as the st=
ruct is POD (Plain Old Data - no embedded pointers,
etc), this will work fine.
however, you need to keep in mind that under some easily encounterable
circumstances, the write may not return sizeof(DataMessage). this is a
very easy mistake to make with ringbuffers (ditto for read).
it can be avoided via careful sizing of the ringbuffer and always
read/writing "whole objects" OR by carefully checking the results=
of
read/write.Thanks for the tips. What s=
hould one do if one detects a partial write? Is it best to have integrity c=
hecks on both ends of the ringbuffer?
the jack ringbuffer design is particular bad in this respect because
it can only hold size-1 bytes (where size is its actual size).Does this mean a good way to initialize it is to ma=
ke the ringbuffer some multiple of the sizeof(myMessageStruct) plus one byt=
e?
Thanks again for all the help.iain
--20cf303dd31202caba04b4056454--
LINUX® is a registered trademark of Linus Torvalds in the USA and other countries.
Linuxaudio.org logo copyright Thorsten Wilms © 2006.
Hosting provided by the Virginia Tech Department of Music and DISIS.