RE: Question about NSThread?
RE: Question about NSThread?
- Subject: RE: Question about NSThread?
- From: Stefan Sinclair <email@hidden>
- Date: Wed, 19 Nov 2008 15:53:59 -0600
- Importance: Normal
Not knowing what your design looks like, in my head I am picturing your worker thread (which reads / generates the images) maintaining a measure of its progress (eg a float from [0,1]) and then exposing that progress value to your main thread in which the UI runs. That is the memory I envisioned potentially being shared across 2 threads. Assuming that's the case, is it safe? Probably. Is it a good habit to get into? Probably not. There is lots of good information available on thread-safe software design and programming practices. My point was just that the feeling that you had about something not seeming right was in fact a correct hunch :)
-Stefan
CC: email@hiddenom: email@hidden: email@hiddenbject: Re: Question about NSThread?Date: Wed, 19 Nov 2008 16:37:18 -0500Mmm I see....
Well, right now I would say my worker thread is pretty much just reading values (size of image to generate etc)... but it's not "modifying" anything... it doesn't change any variables etc... just reads the info it needs to generate the images and ...well, generates the images...
If my worker thread doesn't have to "write" in any variables/objects whatever, shared with the UI, can I assume that it's safe to leave it like it is?
On 19-Nov-08, at 4:32 PM, Stefan Sinclair wrote:
Proud to be a PC? Show the world. Download the “I’m a PC” Messenger themepack now. Download now.
Jean-Nicolas Jolivet
email@hidden
http://www.silverscripting.com
_________________________________________________________________
Access your email online and on the go with Windows Live Hotmail.
http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_access_112008_______________________________________________
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