- You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO might be helpful.
Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO might be helpful.
- Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfConsumers
- the others are bit more convoluted. Adding some documentation comments would help.Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfConsumers
- the others are bit more convoluted. Adding some documentation comments would help.
- You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.
Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO might be helpful.
- Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfConsumers
- the others are bit more convoluted. Adding some documentation comments would help.
You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO might be helpful.
Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfConsumers
- the others are bit more convoluted. Adding some documentation comments would help.
- You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.
Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO This question on SO might be helpful.
- Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfConsumers
- the others are bit more convoluted. Adding some documentation comments would help.
- You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.
Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO might be helpful.
- Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfConsumers
- the others are bit more convoluted. Adding some documentation comments would help.
- You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.
Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO might be helpful.
- Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfConsumers
- the others are bit more convoluted. Adding some documentation comments would help.
- You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.
Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO might be helpful.
- Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfProducersnumberOfConsumers
- the others are bit more convoluted. Adding some documentation comments would help.
- You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.
Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO might be helpful.
- Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfProducers
the others are bit more convoluted. Adding some documentation comments would help.
- You are trying to align each
ref
object to a cache line by padding the object to fill an entire cache line. However yourrefs
vector is embedded as a member in the multiqueue class hence it will start at an offset relative to the beginning of the object which is probably either aligned on a 4 or 8 byte boundary. So yourrefs
vector might start in the middle of a cache line and your padding to cache line size ill not gain you what you wanted.
Aligning a member within a class to a cacheline seems to be a non trivial exercise. This question on SO might be helpful.
- Your code is really hard to understand from just reading mostly due to not very helpful names for parameters to the class. It's not very obvious what the
inthread
,outthread
,unblockconsumer
andunblockproducer
parameters mean and in how far they relate to the workings of the queue. I assumeinthread
isnumberOfProducers
andoutthread
isnumberOfConsumers
- the others are bit more convoluted. Adding some documentation comments would help.