STL Map.find()
-
I am struggling with find() of map for last 15 day, my target is reading EVENTLOGRECORD from all machine at a time (with help of multithread ) and doing some processes on the information and writing to a separate file for each machine. It is working fine for a machine at a time. if I I read more than one machine for > 4 hours data from the machine, the map.find() giving exception . it is not frequently happening What will be the error ? My code map m_eventlist; map::iterator m_iter; m_useriter=m_userlist.find(newkey); - CEvent is a user defined object thanks
-
I am struggling with find() of map for last 15 day, my target is reading EVENTLOGRECORD from all machine at a time (with help of multithread ) and doing some processes on the information and writing to a separate file for each machine. It is working fine for a machine at a time. if I I read more than one machine for > 4 hours data from the machine, the map.find() giving exception . it is not frequently happening What will be the error ? My code map m_eventlist; map::iterator m_iter; m_useriter=m_userlist.find(newkey); - CEvent is a user defined object thanks
I would guess this is because you're accessing the map (and likely other things) from multiple threads without synchronization. Multithreaded programming is hard.
Steve