Re: Do I need to use Distributed Objects or not?
Re: Do I need to use Distributed Objects or not?
- Subject: Re: Do I need to use Distributed Objects or not?
- From: Tim Hart <email@hidden>
- Date: Wed, 9 Feb 2005 20:37:32 -0600
TestKit's TestRunner uses DO to do these kinds of things. Communication
is between processes instead of threads, but the same ideas apply. DO
was easy to implement. I was very happy using it as my main method of
IAC.
1) The GUI process is informed when the faceless process is finished
2) The user can cancel the faceless process
3 The GUI has a progress indicator which is in sync with the processing
done by the faceless process.
The source code is included as part of the distribution. You can also
grab the source from CVS if you prefer.
http://sourceforge.net/projects/testkit
You're welcome to contact me off-list for questions or pointers
regarding the code.
Tim Hart
Macintosh development and consulting
email@hidden :email
(312)560-4267 :phone
On Feb 9, 2005, at 6:05 AM, Michael Becker wrote:
Hi all!
I need to do several thread-worthy little tasks in my application,
e.g. loading data from a server or loading several images (much like
iPhoto's import). I think I know the basic idea of threading in Cocoa
but I was just wondering what exactly I need. I do not want to do it
more complicated than necessary. Here are the general features I need:
1) the main thread needs to be informed when the detached thread has
finished
2) the user should be able to cancel the detached thread (that's not a
big problem, I just use a BOOL flag, right?)
3) the GUI has a progress indicator which should be in sync with
whatever the detached thread does.
I've read in the docs that GUI stuff should always be done from the
main thread, so how do I go about the 3rd feature? Can I make the
controller object a delegate of the threaded object? Do I eventually
need Distributed Objects here or can all this be done in a lighter
way?
As my mechanism should work like iPhoto's image import, I will also
need to update an NSImageView with the image that is currently being
imported... so it all boils down to the question: DO or not DO?
Regards,
Michael
_______________________________________________
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
_______________________________________________
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