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. Thread Timing Issues (Debug/Release)

Thread Timing Issues (Debug/Release)

Scheduled Pinned Locked Moved C#
announcementdebugginghelpquestionlearning
6 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.
  • O Offline
    O Offline
    Office Lineman
    wrote on last edited by
    #1

    Can someone recommend a good resource on resolving thread timing issues? I'm having an issue with a value that doesn't get set "quickly enough" in the debug version, but the release version works nicely. -- I've killed again, haven't I?

    G D 2 Replies Last reply
    0
    • O Office Lineman

      Can someone recommend a good resource on resolving thread timing issues? I'm having an issue with a value that doesn't get set "quickly enough" in the debug version, but the release version works nicely. -- I've killed again, haven't I?

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      You have to make sure that the value really is set before you try to use it. To be more specific is hard without knowing anything about what you are trying to do. The problem has nothing to do with timing, though, but the sharing of data between threads. The code shouldn't rely on one thread being ahead of the other, as that is very unpredictable. Be most grateful that you found this bug already, though. You say that the release version works nicely, but I'm not so sure of that. Perhaps that also fails, only not so often. --- b { font-weight: normal; }

      1 Reply Last reply
      0
      • O Office Lineman

        Can someone recommend a good resource on resolving thread timing issues? I'm having an issue with a value that doesn't get set "quickly enough" in the debug version, but the release version works nicely. -- I've killed again, haven't I?

        D Offline
        D Offline
        Dave Kreskowiak
        wrote on last edited by
        #3

        I think I can speak for all of us when I say "Huh?" What do you "timing issue"? If you're trying to keep two threads in sync, you'll have to use some kind of synchronization mechinism. You absolutely cannot trust that two threads are going to run at exactly the same speed on every machine, let alone run after run on the same machine, or even under slightly differing conditions, like you've already discovered. Off the top of my head, I'm guessing you'll have to implement some kind of "checkpoint" system, depending on what these threads are doing, where each checkpoint will only release when both threads make it to the same point. The down side of this is a lock condition where a thread waits forever for the other thread to get to the checkpoint, but the other thread has failed and aborted for some reason. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

        O M 2 Replies Last reply
        0
        • D Dave Kreskowiak

          I think I can speak for all of us when I say "Huh?" What do you "timing issue"? If you're trying to keep two threads in sync, you'll have to use some kind of synchronization mechinism. You absolutely cannot trust that two threads are going to run at exactly the same speed on every machine, let alone run after run on the same machine, or even under slightly differing conditions, like you've already discovered. Off the top of my head, I'm guessing you'll have to implement some kind of "checkpoint" system, depending on what these threads are doing, where each checkpoint will only release when both threads make it to the same point. The down side of this is a lock condition where a thread waits forever for the other thread to get to the checkpoint, but the other thread has failed and aborted for some reason. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

          O Offline
          O Offline
          Office Lineman
          wrote on last edited by
          #4

          Dave Kreskowiak wrote:

          What do you "timing issue"?

          I speak for myself when I say, "Huh?" :laugh: Never mind the unanswered question; I've solved the issue. -- I've killed again, haven't I?

          1 Reply Last reply
          0
          • D Dave Kreskowiak

            I think I can speak for all of us when I say "Huh?" What do you "timing issue"? If you're trying to keep two threads in sync, you'll have to use some kind of synchronization mechinism. You absolutely cannot trust that two threads are going to run at exactly the same speed on every machine, let alone run after run on the same machine, or even under slightly differing conditions, like you've already discovered. Off the top of my head, I'm guessing you'll have to implement some kind of "checkpoint" system, depending on what these threads are doing, where each checkpoint will only release when both threads make it to the same point. The down side of this is a lock condition where a thread waits forever for the other thread to get to the checkpoint, but the other thread has failed and aborted for some reason. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

            M Offline
            M Offline
            mav northwind
            wrote on last edited by
            #5

            Dave Kreskowiak wrote:

            I think I can speak for all of us when I say "Huh?"

            Hits the spot exactly... :) You know where this originates from? To my knowledge it's actually a quote from a Buffy the vampire slayer episode... :laugh: mav

            D 1 Reply Last reply
            0
            • M mav northwind

              Dave Kreskowiak wrote:

              I think I can speak for all of us when I say "Huh?"

              Hits the spot exactly... :) You know where this originates from? To my knowledge it's actually a quote from a Buffy the vampire slayer episode... :laugh: mav

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Yeah, I realized that after I posted it. A commerical for Buffy reruns came on about a half-hour later! RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

              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