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. WCF and WF
  4. Thread.Abort in WCF Service hosted on WAS restarting the Service

Thread.Abort in WCF Service hosted on WAS restarting the Service

Scheduled Pinned Locked Moved WCF and WF
csharpwcfhelp
3 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.
  • G Offline
    G Offline
    gauravpuri19
    wrote on last edited by
    #1

    I have hosted a WCF service on WAS (on Windows Vista) and the protocol of the endpoint is netTcp. In the service I am starting a thread which takes a long time to run. It runs successfully. The problem is when ever Thread.Abort() is fired it restarts the service instead of aborting that thread only. In the first hit from the client it starts the thread and maintains the thread in the static dictionary and then on the second hit fires the request for cancellation from client to the service, then service method calls the Thread.Abort() for that particular thread I have tried the same using the Console host on the local machine and it's working fine and even aborting the specific thread.

    D 1 Reply Last reply
    0
    • G gauravpuri19

      I have hosted a WCF service on WAS (on Windows Vista) and the protocol of the endpoint is netTcp. In the service I am starting a thread which takes a long time to run. It runs successfully. The problem is when ever Thread.Abort() is fired it restarts the service instead of aborting that thread only. In the first hit from the client it starts the thread and maintains the thread in the static dictionary and then on the second hit fires the request for cancellation from client to the service, then service method calls the Thread.Abort() for that particular thread I have tried the same using the Console host on the local machine and it's working fine and even aborting the specific thread.

      D Offline
      D Offline
      DoctorMick
      wrote on last edited by
      #2

      I don't know why you're experiencing the specific problem but you could look at using an alternative mechanism to Thread.Abort(). Have a read of this. It explains the problems around Thread.Abort and a neat alternative.

      G 1 Reply Last reply
      0
      • D DoctorMick

        I don't know why you're experiencing the specific problem but you could look at using an alternative mechanism to Thread.Abort(). Have a read of this. It explains the problems around Thread.Abort and a neat alternative.

        G Offline
        G Offline
        gauravpuri19
        wrote on last edited by
        #3

        While using the Process class we need to mention the files, so the alternative provided in the article for the usage of Process calls doesn't seems to be feasible as the code is in the Service implementation class.

        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