• 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: Problem killing my threads :)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem killing my threads :)


  • Subject: Re: Problem killing my threads :)
  • From: Guillaume Outters <email@hidden>
  • Date: Mon, 23 Sep 2002 21:24:31 +0200

Le lundi 23 septembre 2002, ` 20:57 PM, Aram Greenman a icrit :

I *think* the operation would always be atomic if the variable assigned to was a single-byte type (i.e. char), but I'm not sure.

I based my assumption on the fact that for this kind of flag, he just needs one bit being set (and read back by the thread). And I think that on any computer since, well let's tell 1946, the bit is atomic :-)

The effective problem is when to do detection; if the thread is some kind of runloop with blocking system calls (NSRunLoop or select or poll), doing so won't resolve the question. There will be some need of either a periodic verification using timers in runloop or timeouts for select, or to have a "communication channel" between both threads, like DO or a pipe watched by the poll(), that can "awake" the thread.

Oh, BTW, could Unix guys tell me if a signal would ensure any select()/poll() on any thread exits with an EINTR?

--
Guillaume Outters
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Problem killing my threads :) (From: Aram Greenman <email@hidden>)

  • Prev by Date: Re: Custom NSTextField & keyDown:
  • Next by Date: Re: Scaling down an image proportionally
  • Previous by thread: Re: Problem killing my threads :)
  • Next by thread: Re: Problem killing my threads :)
  • Index(es):
    • Date
    • Thread