Thread Communication Conceptual Question
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