Re: Question about NSThread

2011-07-14 Thread Ken Thomases
On Jul 14, 2011, at 9:08 AM, Eric E. Dolecki wrote: > I haven't done much research, but if I have a method that does a lot of > looping, can I just safely bust this off (fire and forget)? > > [NSThread detachNewThreadSelector:@selector(generateBigData) toTarget:self > withObject:nil]; When it co

Re: Question about NSThread

2011-07-14 Thread Eric E. Dolecki
Thank you for your feedback, I appreciate it. Eric On Thu, Jul 14, 2011 at 10:38 AM, Jeff Kelley wrote: > You *can*, but there is a limit to the number of threads you can create, > and > even if you’re under the limit, you’ll likely be pegging the CPU in an > inefficient way. You would be bette

Re: Question about NSThread

2011-07-14 Thread Jeff Kelley
You *can*, but there is a limit to the number of threads you can create, and even if you’re under the limit, you’ll likely be pegging the CPU in an inefficient way. You would be better served using GCD and creating a dispatch queue, then scheduling the task on that queue (or just using a global que

Question about NSThread

2011-07-14 Thread Eric E. Dolecki
I haven't done much research, but if I have a method that does a lot of looping, can I just safely bust this off (fire and forget)? [NSThread detachNewThreadSelector:@selector(generateBigData) toTarget:self withObject:nil]; ___ Cocoa-dev mailing list (C

RE: Question about NSThread?

2008-11-19 Thread Stefan Sinclair
about something not seeming right was in fact a correct hunch :) -Stefan CC: [EMAIL PROTECTED]: [EMAIL PROTECTED]: [EMAIL PROTECTED]: 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 v

RE: Question about NSThread?

2008-11-19 Thread Stefan Sinclair
a-dev@lists.apple.com> Date: Wed, 19 Nov 2008 15:57:44 -0500> Subject: Question about NSThread?> > I have an app that generates a bunch of images... the process can be > long so I wanted to start it in a separate thread so that the UI can > be responsive etc...> > bas

Re: Question about NSThread?

2008-11-19 Thread Michael Ash
On Wed, Nov 19, 2008 at 6:32 PM, Jean-Nicolas Jolivet <[EMAIL PROTECTED]> wrote: > One question... you wrote: > >> So when >> dealing with unknown objects whose thread safety is not documented, >> you cannot access them from multiple threads without synchronization >> just because they present an

Re: Question about NSThread?

2008-11-19 Thread Jean-Nicolas Jolivet
One question... you wrote: So when dealing with unknown objects whose thread safety is not documented, you cannot access them from multiple threads without synchronization just because they present an immutable interface. When you talk about "accessing" these objects, do you also mean read

Re: Question about NSThread?

2008-11-19 Thread Jean-Nicolas Jolivet
Thanks for all the reply! By digging a little deeper I can see that everything isn't working quite as smoothly as I thought it was...! All the info is quite welcomed! Jean-Nicolas Jolivet On 19-Nov-08, at 3:57 PM, Jean-Nicolas Jolivet wrote: I have an app that generates a bunch of images.

Re: Question about NSThread?

2008-11-19 Thread Michael Ash
On Wed, Nov 19, 2008 at 3:57 PM, Jean-Nicolas Jolivet <[EMAIL PROTECTED]> wrote: > I have an app that generates a bunch of images... the process can be long so > I wanted to start it in a separate thread so that the UI can be responsive > etc... > > basically the only thing I did was: > > [NSThread

Re: Question about NSThread?

2008-11-19 Thread Jean-Daniel Dupas
ds even for small things like this. -Stefan > From: [EMAIL PROTECTED] > To: cocoa-dev@lists.apple.com > Date: Wed, 19 Nov 2008 15:57:44 -0500 > Subject: Question about NSThread? > > I have an app that generates a bunch of images... the process can be > long so I wante

Re: Question about NSThread?

2008-11-19 Thread Kai
/written in a single instruction) while the worker thread is modifying it. But it doesn't hurt to use proper thread- safe access patterns for data shared between threads even for small things like this. -Stefan > From: [EMAIL PROTECTED] > To: cocoa-dev@lists.apple.com > Date: We

Re: Question about NSThread?

2008-11-19 Thread Jean-Nicolas Jolivet
be read/written in a single instruction) while the worker thread is modifying it. But it doesn't hurt to use proper thread-safe access patterns for data shared between threads even for small things like this. -Stefan > From: [EMAIL PROTECTED] > To: cocoa-dev@lists.apple.com >

Question about NSThread?

2008-11-19 Thread Jean-Nicolas Jolivet
I have an app that generates a bunch of images... the process can be long so I wanted to start it in a separate thread so that the UI can be responsive etc... basically the only thing I did was: [NSThread detachNewThreadSelector:@selector(doLongProcess) toTarget:self withObject:nil]; and