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. Threads problem

Threads problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpdatabasequestion
1 Posts 1 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.
  • Y Offline
    Y Offline
    yamini
    wrote on last edited by
    #1

    I have a problem with Threads !In a console application ,I am trying to create 10 threads using CreateThread(..). Each Thread created tries to call the interface function which will add records to database !The problem is I have given separate ThreadProcs for each thread .But, what happens is some threads log more than once.So, the loggings of some threads are lost !But, teh number of loggings are correct !How can I rectify the problem ! The Mutexes need not do anything here .But, i can get the correct result only if I use Mutex at the start of each ThreadProc .It is logically wrong !How can i rectify the problem ! Thanx in advance for the help ! Regards, yamini Y.Yamini Devi.

    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