|
I have a Tqueue queue,
One thread keeps adding data, and the other thread keeps reading and deleting. This way, address errors often occur from time to time, how to solve it. I have used critical sections, but I am not good at critical sections.
It seems that the critical section is only valid for multi-threaded access to the same piece of code. What should I do if global variables are used everywhere? |
|