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. Prob on Multi-Threaded Application

Prob on Multi-Threaded Application

Scheduled Pinned Locked Moved C / C++ / MFC
comhelp
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
    Sujan Christo
    wrote on last edited by
    #1

    Hi Friends, I am working with a multithreaded application. The problem which i am facing is sometimes the application shutdown is not proper (seems that the application is in waiting state). I am using CriticalSection also for data sync. Is there any tool which shows the current thread status..etc. Sujan Note: i do have the process explorer from sysinternals.com. In the process viewer it is showing that the application is waiting on the ntdelayexecution thread.

    B 1 Reply Last reply
    0
    • S Sujan Christo

      Hi Friends, I am working with a multithreaded application. The problem which i am facing is sometimes the application shutdown is not proper (seems that the application is in waiting state). I am using CriticalSection also for data sync. Is there any tool which shows the current thread status..etc. Sujan Note: i do have the process explorer from sysinternals.com. In the process viewer it is showing that the application is waiting on the ntdelayexecution thread.

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      Are you using WaitForX (Single Object, MultipleObjects) or MsgWaitForX (same thing) at all? More than one critical section, leading to a deadlock situation?. Otherwise, your applciaiton wants to exit, but one or more of your threads are still blocked waiting for a mutex, event, etc. You should design your threads to wait for MORE than one object, typically the processing object, and an event object you can 'set' from the main thread when the program is about to exit. Then when progrma is about to exit, it signals event for thread(s) to exit, waits for thread(s) to exit, and then the main program's thread can exit. How do you detect that a thread has exited? The thread can set an event the main thread is waiting on, the thread can clear/set a variable the main thread can check, or main thread can wait for thread handle to be signaled. see documentaiton for _beginthreadex

      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