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. Managed C++/CLI
  4. Threading

Threading

Scheduled Pinned Locked Moved Managed C++/CLI
tutorialhelpquestionloungelearning
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.
  • J Offline
    J Offline
    jblau
    wrote on last edited by
    #1

    I am trying to teach myself threading from a book, but the book I have isn't helping me very much. My main thread sends off another thread. The new thread could at any given moment be either running or suspended. I want to be able to abort that thread and creat it again so that it starts at the begining of its process. The problem I am having is that depending upon whatever random moment I click the button that does this; I sometimes get either a ThreadAbortException or a ThreadStateException. For some reason my try--catch isn't catching them. I don't suppose anyone would be able to give me a little example of how to work with threads in this way????? Thanks, Jody Blau

    D 1 Reply Last reply
    0
    • J jblau

      I am trying to teach myself threading from a book, but the book I have isn't helping me very much. My main thread sends off another thread. The new thread could at any given moment be either running or suspended. I want to be able to abort that thread and creat it again so that it starts at the begining of its process. The problem I am having is that depending upon whatever random moment I click the button that does this; I sometimes get either a ThreadAbortException or a ThreadStateException. For some reason my try--catch isn't catching them. I don't suppose anyone would be able to give me a little example of how to work with threads in this way????? Thanks, Jody Blau

      D Offline
      D Offline
      David Moody
      wrote on last edited by
      #2

      Try this: Catch ex As ThreadAbortException Trace.WriteLine("READ THREAD ABORT EXCEPTION!") 'Allow the thread to continue aborting: Thread.ResetAbort() david

      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