Skip navigation.
 
mlThread question
FROM : Hisaoki Nishida
DATE : Sun Nov 10 22:58:23 2002

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_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

Related mailsAuthorDate
mlThread question Hisaoki Nishida Nov 10, 22:58
mlRe: Thread question Nathan Day Nov 11, 12:50
mlRe: Thread question Hisaoki Nishida Nov 13, 07:18
mlRe: Thread question Nathan Day Nov 14, 01:19