• 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: CFMessagePort, audio sampling and sending UDP packets
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CFMessagePort, audio sampling and sending UDP packets


  • Subject: Re: CFMessagePort, audio sampling and sending UDP packets
  • From: Mark Pauley <email@hidden>
  • Date: Fri, 13 Feb 2009 14:36:09 -0800

Why not just use a CFRunLoopSource? All you need to do is wake the consumer up right? Schedule the CFRunLoopSource on your main thread, also whenever you signal it make sure to call CFRunLoopWakeUp on the main thread after signaling the source, apparently signaling a source isn't sufficient to wake up any runloops the source may be scheduled on.


Alternatively, you could even just go with a simple semaphore initialized to 0 if you could move your consumer thread to a non-main thread. The consumer does: sem_down, dequeue, send repeat; the producer does sample, enqueue, sem_up, repeat.


If you use either of these schemes, you'd best use a spin-lock to synchronize your queue operations, they're cheap for that sort of thing.


On Feb 13, 2009, at 2:15 PM, Joel Reymont wrote:


On Feb 13, 2009, at 10:00 PM, Jens Alfke wrote:

Use an AudioQueue instead? That way all of your code runs on the main thread and it's OK to do things like send packets from the callback.


Latency too high. What about my CFMessagePort question?

Is CFMessagePort light to use here? Too heavy and there are simpler ways?

	Thanks, Joel

---
http://tinyco.de
--- Mac & iPhone




_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden

_Mark email@hidden




_______________________________________________ Do not post admin requests to the list. They will be ignored. Macnetworkprog mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: CFMessagePort, audio sampling and sending UDP packets
      • From: Joel Reymont <email@hidden>
References: 
 >CFMessagePort, audio sampling and sending UDP packets (From: Joel Reymont <email@hidden>)
 >Re: CFMessagePort, audio sampling and sending UDP packets (From: Jens Alfke <email@hidden>)
 >Re: CFMessagePort, audio sampling and sending UDP packets (From: Joel Reymont <email@hidden>)

  • Prev by Date: Re: CFMessagePort, audio sampling and sending UDP packets
  • Next by Date: Re: CFMessagePort, audio sampling and sending UDP packets
  • Previous by thread: Re: CFMessagePort, audio sampling and sending UDP packets
  • Next by thread: Re: CFMessagePort, audio sampling and sending UDP packets
  • Index(es):
    • Date
    • Thread