N
naveen
Hi guys
For STL Queue, I would like to analyze following scenerio
1. Multiple threads writting to the Q and multiple threads reading
from it. Mutex will be needed since multiple threads might be
accessing same address from the Q.
2. Multiple threads writting to the Q and **single** thread reading
from it. Mutex will be needed since multiple threads might be
accessing same address from the Q.
3. Single thread writting to the Q and single thread( different than
the first one) reading from it. Is the mutex needed in this case
also ? or we can live without mutex.
I would like to minimize the mutex usage, please go through the
scenerios written above.
If mutex is needed in all the cases, can you suggest me some other
data structure where message can be written and read without locks or
with minimum locking
thanks
Naveen
For STL Queue, I would like to analyze following scenerio
1. Multiple threads writting to the Q and multiple threads reading
from it. Mutex will be needed since multiple threads might be
accessing same address from the Q.
2. Multiple threads writting to the Q and **single** thread reading
from it. Mutex will be needed since multiple threads might be
accessing same address from the Q.
3. Single thread writting to the Q and single thread( different than
the first one) reading from it. Is the mutex needed in this case
also ? or we can live without mutex.
I would like to minimize the mutex usage, please go through the
scenerios written above.
If mutex is needed in all the cases, can you suggest me some other
data structure where message can be written and read without locks or
with minimum locking
thanks
Naveen