Thread question
Thread question
- Subject: Thread question
- From: Hisaoki Nishida <email@hidden>
- Date: Sun, 10 Nov 2002 16:58:23 -0500
Hi,
I have an object (obj A) that has a method that runs in a separate
thread. The method uses the object's global variable. I have another
object (obj B) that posts s notification, where in the notification
center obj A is registered. As obj A receives the notification, in it's
main thread (not the separate thread) there is a method that handles
the notification. The method modifies it's global variable that is
shared with the separate thread.
Is there a need for me to prevent the simultaneous occurrence of write
and read for this variable?
Or, does Mac OS X handle this internally, using protective memory, so
there is no worry for me about this?
I know in Java you have to use 'synchronized' for this.
Thank you.
-Yuki
_______________________________________________
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.