Re: How should I debug or adobt better data processing for high sp
"Electronic75" <Electronic75@discussions.microsoft.com> wrote in message
news:C8D09E23-45EC-4736-A644-FBC8E7594658@microsoft.com...
Hello Scott,
Can you explain more please?
do you mean that my presumption that additional copy pasting of data to
volatile variables(or any variable) will take additional computational
power
is wrong?
or my presumption that data that changes rapidly should be saved in a
volatile type of variable is wrong? or you mean something else?
Both statements are wrong and completely unrelated to volatile variables. I
can only suggest that you consult a textbook or perhaps wikipedia. Volatile
has nothing to do with data that changes rapidly, it has to do with data
that changes asynchronously. It has nothing to do with additional
computational power: A volatile variable is an ordinary memory location,
accessed the same way as a non-volatile variable.
anyway I usually save data that I know changes rapidly in a volatile
variable. I really don't see any misunderstanding of volatile concept
really?
if there is a hole in my knowledge please enlighten me.
Anyway about your original suggestion that producer thread sends pointer
of
a buffer to the consumer thread then consumer thread reads and deletes it.
There is a fade sense(I could be wrong) in background of my mind that I
have
read something about messages that in certain circumstances never reach
their destination and become lost. If even there is such possibility (no
matter how remote) then it could be really spooky! because it can easily
lead
to memory leak and Ctrl+Alt+Delete.
There is some limit on the message queue depth, on the order of tens of
thousands of messages. I would be poor design to test that limit. Other
than that, the technique is standard and well-proven. Utterly reliable for
me in applications that, at most, post a hundred messages per second.
--
Scott McPhillips [VC++ MVP]