• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Setting up an auxiliary task for use with Distributed Objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting up an auxiliary task for use with Distributed Objects


  • Subject: Setting up an auxiliary task for use with Distributed Objects
  • From: Oleg Krupnov <email@hidden>
  • Date: Thu, 16 Apr 2009 12:01:31 +0300

I'm looking for the right way of setting up the auxiliary NSTask from
within the main task. The aux task vends some Distributed Objects, and
the main task uses them.

The auxiliary task does this:

NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];

MyVendedObject* vendedObj = [[[MyVendedObject alloc] init] autorelease];

NSConnection* connection = [NSConnection defaultConnection];
[connection setRootObject:vendedObj];
if ([connection registerName:@"MyAuxTask"])
{
	[[NSRunLoop currentRunLoop] run];
}

[pool release];
return 0;

As I understand, as soon as the aux tasks reaches the runloop's run
message, it blocks and is ready for connection messages.

However there are 2 problems:

1) I need to block the main task until the aux task is ready to work.
How do I do it? Sleep/poll connection/repeat doesn't seem a good
approach, is there any better way?

2) How do I quit the aux task? [NSTask terminate] does not work,
invalidating the connection does not work...
_______________________________________________

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

  • Follow-Ups:
    • Re: Setting up an auxiliary task for use with Distributed Objects
      • From: Ken Thomases <email@hidden>
    • Re: Setting up an auxiliary task for use with Distributed Objects
      • From: "Jeremy W. Sherman" <email@hidden>
  • Prev by Date: Re: Best way to pass large objects between tasks?
  • Next by Date: sending emails using URLRequest and php
  • Previous by thread: Re: -viewDidMoveToWindow without subclassing? NSViewController?
  • Next by thread: Re: Setting up an auxiliary task for use with Distributed Objects
  • Index(es):
    • Date
    • Thread