• 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
Worker threads and UI threads
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Worker threads and UI threads


  • Subject: Worker threads and UI threads
  • From: Chris DeSalvo <email@hidden>
  • Date: Thu, 06 Jun 2002 20:03:31 -0700

My attempts to have a worker thread send updates to the main application
thread are still failing. Although the messages are getting sent (via
NSNotificationCenter) the receiver is always executing in the worker
thread's context. As such, all the UI code I'm calling is dying.

I tried replacing all of my uses of NSNotificationCenter with
NSDistributedNotificationCenter, and this did in fact get thing executing in
the right context. However, only the first message ever made it through and
I never got any more, even though I could see them being posted.

I then tried created my own private NSNotificationQueue and attaching it to
the NSNotificationCenter of the main thread and having my worker thread post
updates through that. No notifications ever came through at all.

Does anyone know of some working sample code that has a working thread
posting messages to the main app thread so that the main thread can update
UI?

Thanks,
Chris
_______________________________________________
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.

  • Follow-Ups:
    • Re: Worker threads and UI threads
      • From: Nathan Day <email@hidden>
    • Re: Worker threads and UI threads
      • From: Raphael Sebbe <email@hidden>
    • Re: Worker threads and UI threads
      • From: Cryx <email@hidden>
  • Prev by Date: DnD for NSTextFields, Drag'n'Drop
  • Next by Date: Re: Worker threads and UI threads
  • Previous by thread: Re: DnD for NSTextFields, Drag'n'Drop
  • Next by thread: Re: Worker threads and UI threads
  • Index(es):
    • Date
    • Thread