Results 1 to 2 of 2

Thread: Abort thread in C#

  1. #1
    acbell is offline Registered User
    Name: Andrew Bell
    Organization: Iowa State University
    Project: National Resources Inventory
    Join Date
    Jan 2005
    Location
    Ames, IA, USA
    Posts
    89

    Abort thread in C#

    Hi,

    I am creating a thread from my C# application which makes an ICE request to a server. In some cases, I abort the thread that I created. This appears to be causing an assertion failure in Outgoing.finished(BasicStream). I know aborting the thread is bad practice, and I can change my code, but I was wondering if someone can tell me what might be going on.

    Thanks as always,

  2. #2
    michi's Avatar
    michi is offline Registered User
    Name: Michi Henning
    Organization: Triodia Technologies
    Project: I have a passing interest in Ice :-)
    Join Date
    Feb 2003
    Location
    Brisbane, Australia
    Posts
    1,055
    The run time contains various assertions to make sure that its data structures are in a consistent state. If you abort a thread while it is inside the run time, you will simply mess up Ice's internal housekeeping in most cases--the assertion catches that just as intended.

    I'm afraid that you will have to change your code. The run time isn't designed to cope with threads disappearing without warning at unpredictable times (and I don't see how the run time could be designed to cope with that, even theoretically). The situation is much the same as with thread cancellation in C++: in general, you cannot use it because destructors will no longer run, making a complete mess of any invariants.

    Cheers,

    Michi.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Response thread
    By ngambek2003 in forum Help Center
    Replies: 19
    Last Post: 05-03-2010, 06:27 PM
  2. Replies: 3
    Last Post: 03-01-2010, 05:45 PM
  3. Confused Abort ICEPHP
    By coofucoo in forum Help Center
    Replies: 2
    Last Post: 07-04-2008, 04:55 AM
  4. a thread problem
    By fw_csha in forum Help Center
    Replies: 2
    Last Post: 05-15-2005, 05:41 AM
  5. problem of abort() invoked by GC::GC()
    By paulling in forum Help Center
    Replies: 6
    Last Post: 12-26-2003, 04:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •