• 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
Re: Setting up an auxiliary task for use with Distributed Objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting up an auxiliary task for use with Distributed Objects


  • Subject: Re: Setting up an auxiliary task for use with Distributed Objects
  • From: "Jeremy W. Sherman" <email@hidden>
  • Date: Thu, 16 Apr 2009 09:27:02 -0400

On Thu, Apr 16, 2009 at 5:01 AM, Oleg Krupnov <email@hidden> wrote:
> 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
>
_______________________________________________

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

References: 
 >Setting up an auxiliary task for use with Distributed Objects (From: Oleg Krupnov <email@hidden>)

  • Prev by Date: Re: nstoolbar in tiger
  • Next by Date: Fwd: Setting up an auxiliary task for use with Distributed Objects
  • Previous by thread: Setting up an auxiliary task for use with Distributed Objects
  • Next by thread: Fwd: Setting up an auxiliary task for use with Distributed Objects
  • Index(es):
    • Date
    • Thread