http://relacy.pastebin.com/f6911ad8e
This uses eventcounts to allow for blocking on queue full/empty conditions.
Enjoy!
I've noticed there is a line:
unsigned state_workaround = f->m_state($); // Relacy Bug?
What do you mean here? I can't catch up at a moment...
Also I've noticed that you zeroize buffer in ctor:
for (std::size_t i = 0; i < T_size; ++i) {
m_buffer[i]($) = T();
}
Is it required? IMHO it's better to leave as many variables
uninitialized as possible, because it's allows more possibilities for
automatic error detection.
--
Dmitriy V'jukov
> I've noticed there is a line:
> unsigned state_workaround = f->m_state($); // Relacy Bug?
> What do you mean here? I can't catch up at a moment...
Here is an example of what I seem to have found:
http://relacy.pastebin.com/f34a14497
Run the test in Debug mode as-is and examine the output for a couple of
seconds... Then, uncomment the `EXPOSE_POSSIBLE_BUG' macro, run the test
again and examine the output. Instead of printing the actual value of the
`foo::m_state' member, it seems to print out a pointer value or something.
Can you reproduce the behavior on your end?
> Also I've noticed that you zeroize buffer in ctor:
> for (std::size_t i = 0; i < T_size; ++i) {
> m_buffer[i]($) = T();
> }
> Is it required?
Nope, its not required. I forgot why I was doing that in the first place.
Yikes!
;^/
> IMHO it's better to leave as many variables
> uninitialized as possible, because it's allows more possibilities for
> automatic error detection.
Agreed.