• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Killing a Thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Killing a Thread


  • Subject: Re: Killing a Thread
  • From: Scott Ribe <email@hidden>
  • Date: Wed, 26 Nov 2008 08:34:36 -0700
  • Thread-topic: Killing a Thread

> The application is not crashing, but the thread is not exiting. From UI I'm
> giving a time interval say 10sec is set for the time interval between emails
> to be send. At the first time when I'm clicking the button to send email,
> the thread is getting called and is working fine and sends email to all
> email id's with a time interval of 10Sec. After that the thread is not exit
> and invokes the thread in every 10Sec. So when I'm button second time, the
> application get hanged, all windows and buttons get disabled and I can quit
> the application from debugger only.

1) If the thread is not exiting, then your function that you call on that
thread never completes, and you need to figure out why it doesn't.

Or 2) Or maybe it does complete, but without releasing a lock that it took.
You see, even if the thread didn't exit, that by itself would not cause a
hang when you try to create a new thread for the same function. In the
absence of locking in your code, you could create many many threads all
running the same function.

Or 3) You don't have explicit locking code of your own, but you're calling
code that does, and as in 1, the function you're calling never completes and
returns, thus holding a lock on some shared resource.

Impossible to say which without more information, but the solution is
absolutely NOT a "kill_thread" function.

--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Killing a Thread
      • From: Scott Ribe <email@hidden>
References: 
 >Re: Killing a Thread (From: Mahaboob <email@hidden>)

  • Prev by Date: Re: to get handle to "File/1.jpg"
  • Next by Date: Re: to get handle to "File/1.jpg"
  • Previous by thread: Re: Killing a Thread
  • Next by thread: Re: Killing a Thread
  • Index(es):
    • Date
    • Thread