Re: More efficient solution than DO?
Re: More efficient solution than DO?
- Subject: Re: More efficient solution than DO?
- From: Nathan Day <email@hidden>
- Date: Tue, 30 Jul 2002 16:16:52 +0930
I have an class for doing just that on my iTool err .Mac site
http://homepage.mac.com/nathan_day/, it's called NDRunLoopMessenger and
it is very simple to use. It works by passing just the address of an
NSInvocation and also an NSLock if you are expecting a return value, so
it doesn't have to do all of the serialization associated with a DO,
though I haven't done any real comparisons. You can two way messaging by
simply setting up two NDRunLoopMessenger, one for each of the NSRunloops
associated with your NSThreads. Your free to take advantage of it, use
as is or as an example.
On Tuesday, July 30, 2002, at 06:26 AM, Julian Barkway wrote:
Here's the problem: I have a thread which runs happily and occasionally
sends a message or two to a vended proxy UI object in the main thread
to keep the user informed of its progress. All this works quite nicely
but it's too slow. Anyone know a nice, low-overhead, solution to
passing messages to (and getting stuff back from) an object residing in
a different thread?
I know Cocoa provides wrappers for Mach messaging but my Unix skills
are not that great (I'm still learning!) and I need a few pointers as
to how to go about this, whether it's feasible or even whether it's
desirable. Would it provide a decent speed up? Would I be able to
handle two-way message-passing?
Any pointers gratefully received (failing that, just send money or
young virgins :o) )
Nathan Day
http://homepage.mac.com/nathan_day/
_______________________________________________
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.