• 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
Thread Communication Conceptual Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Thread Communication Conceptual Question


  • Subject: Thread Communication Conceptual Question
  • From: Eyal Redler <email@hidden>
  • Date: Thu, 02 Aug 2007 12:21:59 +0300

Hi,

I think this is a rather basic threading issue but I'm not very experienced with thread so I'd appreciate any help on the subject.

I'm writing a little library that needs to be integrated into both Cocoa and Carbon applications. Because the library needs to be API agnostic, I plan to use pthreads and Not NSThread but the library is integrated (at the moment) within a Cococa application.

One of the library calls starts a thread which in turn calls a callback routine. Since the callback executed inside the sub-thread, I need to somehow cause some code to be executed on the main thread but since the thread itself was not created by the parent application I'm not sure I can use distributed objects, the library can also start and stop the sub threads at its own discretion.

I thought about using DO but all the example code I saw was in the context of communicating between threads that were created by me, which is not the case here.

So, assuming I have a routine which is executed on an "unknown" thread, what's the simplest way to pass a message to the main thread?

TIA

Eyal



_______________________________________________

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: Thread Communication Conceptual Question
      • From: Filipe Varela <email@hidden>
  • Prev by Date: NSWindowController to manage two NSWindow instances
  • Next by Date: applicationShouldOpenUntitledFile not invoked
  • Previous by thread: Re: NSWindowController to manage two NSWindow instances
  • Next by thread: Re: Thread Communication Conceptual Question
  • Index(es):
    • Date
    • Thread