Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. STL Map.find()

STL Map.find()

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++question
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shadrach_india
    wrote on last edited by
    #1

    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

    S 1 Reply Last reply
    0
    • S shadrach_india

      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

      S Offline
      S Offline
      Stephen Hewitt
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups