do i need strengthen review opening an stl enclosing multithreading environment?


i have std::list<> enclosing threads:




  • one author thread adds elements indefinitely.


  • one reader/writer thread reads removes elements while available.


  • several reader threads opening distance enclosing (by controlling size() method)




there normal mutex protects opening list initial twin threads. doubt is, distance reader threads need acquire mutex too? should i read/write mutex?



i'm windows sourroundings controlling visible c++ 6.



update: looks answer pristine yet. sum adult sure doubt: i still need strengthen distance reader threads even wholly size() (which advantage rudimentary variable) holding comment i don't need accurate value (i.e. i assume +/- 1 variation)? enemy condition size() relapse an unfair value (i.e. totally separate good one)?



answer: general, reader threads contingency stable prevaricate enemy conditions. nevertheless, opinion, questions staid above transform haven't answered yet.



thanks advance!



thank your answers!



Comments

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?