• 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: Help with threads and queues
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with threads and queues


  • Subject: Re: Help with threads and queues
  • From: Dave DeLong <email@hidden>
  • Date: Thu, 29 Apr 2010 11:20:47 -0600

Whoops, that should've been dispatch_async and not dispatch_queue_async.

Silly typing code in an email window...

Dave

On Apr 29, 2010, at 10:26 AM, Dave DeLong wrote:

> #import <dispatch/dispatch.h>
>
> //somewhere reasonably accessible to your producer:
> dispatch_queue_t mySerialQueue = dispatch_queue_create("franz.p.paul.myserialqueue", NULL);
>
> //in your producer:
> id newResource = ....; // the thing you want to notifyAll() about
> dispatch_queue_async(mySerialQueue, ^{
>  /**
>    do something with newResource here.
>    this could mean putting your consumer code in here, or passing the resource off to another object, etc
>  **/
> });
>
> //when you're done producing:
> dispatch_release(mySerialQueue);

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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: Help with threads and queues
      • From: Paul Franz <email@hidden>
References: 
 >Help with threads and queues (From: Paul Franz <email@hidden>)
 >Re: Help with threads and queues (From: Thomas Clement <email@hidden>)
 >Re: Help with threads and queues (From: Paul Franz <email@hidden>)
 >Re: Help with threads and queues (From: Dave DeLong <email@hidden>)

  • Prev by Date: Re: Help with threads and queues
  • Next by Date: Seeking a graceful way to end a program
  • Previous by thread: Re: Help with threads and queues
  • Next by thread: Re: Help with threads and queues
  • Index(es):
    • Date
    • Thread