Question on thread safety of objects
Question on thread safety of objects
- Subject: Question on thread safety of objects
- From: Philip Lukidis <email@hidden>
- Date: Thu, 16 Mar 2006 13:36:49 -0500
Hello. I'm quite new to Cocoa; most of my familiarity with OSX comes from
CF and kext programming. Lately, I've designed and implemented a CF based
framework, for which I wanted a simple UI tool for testing. Of course, I'm
using Cocoa for this, and I have a quick question.
I have a background thread in the C++ section of my UI tool. This is
necessary because my framework sends me notifications on its created thread.
I have need to update my UI based on the notification data. For now, the
notification information is converted to a string, and sent to a NSTextView.
However, I think that I've blundered into threadsafe issues here, because it
fails right away on a dual G5, and much less frequently on my single CPU dev
machine. For now I use CFMessagePorts to send a message to the main thread,
and when I update the NSTextView in this thread, I have no crashes.
Is there a simpler way? CFMessagePort is no good, because in NULL reply
mode there is crazy memory growth within the object (in its dictionary
IIRC). To cope with this, I will have to use mach messages, but before I
tangle with those again, I'm wondering if there is a much simpler way to do
this. Any ideas?
thanks,
Philip Lukidis
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden