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#
  4. Debugging a C# MultiThreaded Code

Debugging a C# MultiThreaded Code

Scheduled Pinned Locked Moved C#
csharpquestionvisual-studiodebugginghelp
4 Posts 4 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.
  • C Offline
    C Offline
    ctrlnick
    wrote on last edited by
    #1

    Hi All , I have an application written in C# , that has multi threading , While I am debugging the code the process flow suddenly jumps to an unknown position in the solution. I am sure that the current method it is in now is not called by the previous one I was debugging. But I am close to sure that a thread is running parallel to the current thread I am debugging, Is there a way in Visual Studio or is there a 3rd party tool that will help me visualise the threads parallely or is there a way that we can debug the 2 threads on same go simultaneously? If I put more time and effort and a lot of jotting down on the paper I can figure out what is happening but wouldnt it be good if I know of a better way to do my job! Hoping for the best , Thank You Nikhil Pagidala

    Happy Programming! Regards, Nikhil Pagidala

    L P L 3 Replies Last reply
    0
    • C ctrlnick

      Hi All , I have an application written in C# , that has multi threading , While I am debugging the code the process flow suddenly jumps to an unknown position in the solution. I am sure that the current method it is in now is not called by the previous one I was debugging. But I am close to sure that a thread is running parallel to the current thread I am debugging, Is there a way in Visual Studio or is there a 3rd party tool that will help me visualise the threads parallely or is there a way that we can debug the 2 threads on same go simultaneously? If I put more time and effort and a lot of jotting down on the paper I can figure out what is happening but wouldnt it be good if I know of a better way to do my job! Hoping for the best , Thank You Nikhil Pagidala

      Happy Programming! Regards, Nikhil Pagidala

      L Offline
      L Offline
      Luis Alonso Ramos
      wrote on last edited by
      #2

      My answer is that I don't know, but I can offer a couple of tips: you can set breakpoints and see the executing thread to see if things are going like expected. You can also use a log (with Debug.Print) to see things as they are happening (use a timestamp).

      Nikhil Pagidala wrote:

      If I put more time and effort

      Multithreading debugging has always been *very* hard. If you multithreading bugs, you will spend a lot of time tracking them down. Good luck :)

      Luis Alonso Ramos Intelectix Chihuahua, Mexico

      My Blog!

      1 Reply Last reply
      0
      • C ctrlnick

        Hi All , I have an application written in C# , that has multi threading , While I am debugging the code the process flow suddenly jumps to an unknown position in the solution. I am sure that the current method it is in now is not called by the previous one I was debugging. But I am close to sure that a thread is running parallel to the current thread I am debugging, Is there a way in Visual Studio or is there a 3rd party tool that will help me visualise the threads parallely or is there a way that we can debug the 2 threads on same go simultaneously? If I put more time and effort and a lot of jotting down on the paper I can figure out what is happening but wouldnt it be good if I know of a better way to do my job! Hoping for the best , Thank You Nikhil Pagidala

        Happy Programming! Regards, Nikhil Pagidala

        P Offline
        P Offline
        pbraun
        wrote on last edited by
        #3

        I had that happen many times to me. The problem is that the compiler has not compiled your changes into the executable. I saw this happen many times with Visual Studio .Net 2003. The solution to this is to shutdown Visual Studio, start it back up again, then compile and start your debug information. Phil

        1 Reply Last reply
        0
        • C ctrlnick

          Hi All , I have an application written in C# , that has multi threading , While I am debugging the code the process flow suddenly jumps to an unknown position in the solution. I am sure that the current method it is in now is not called by the previous one I was debugging. But I am close to sure that a thread is running parallel to the current thread I am debugging, Is there a way in Visual Studio or is there a 3rd party tool that will help me visualise the threads parallely or is there a way that we can debug the 2 threads on same go simultaneously? If I put more time and effort and a lot of jotting down on the paper I can figure out what is happening but wouldnt it be good if I know of a better way to do my job! Hoping for the best , Thank You Nikhil Pagidala

          Happy Programming! Regards, Nikhil Pagidala

          L Offline
          L Offline
          L Henson
          wrote on last edited by
          #4

          What about using the Threads window and freezing/thawing threads as you need them?

          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