• 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: best way to divert callbacks to main thread from audio thread
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: best way to divert callbacks to main thread from audio thread


  • Subject: Re: best way to divert callbacks to main thread from audio thread
  • From: Jean-Daniel Dupas <email@hidden>
  • Date: Tue, 04 Oct 2011 11:35:09 +0200

Le 3 oct. 2011 à 20:08, Kyle Sluder a écrit :

> On Mon, Oct 3, 2011 at 10:24 AM, Paul Davis <email@hidden> wrote:
>> On Mon, Oct 3, 2011 at 1:19 PM, Kyle Sluder <email@hidden> wrote:
>>> On Mon, Oct 3, 2011 at 7:42 AM, Paul Davis <email@hidden> wrote:
>>>> the fastest is to post a mach message to a mach port. since i know
>>>> libpd is open source, i suggest you take a look at the jack sources if
>>>> you want some examples on how to do this. its pretty easy.
>>>
>>> Mach is SPI and inaccessible on iOS.
>>
>> SPI ?
>>
>
> System Programming Interface. One of those Apple terms for "the layers
> of the cake you're not allowed to touch." Although the actual
> definition seems to be kind of nebulous.
>
> I should mention the caveat that my information is second-hand. Our
> engineering lead has mentioned that we've received complaints from
> Apple about our use of Mach ports in the past.

The last recommendation I found (at least for Mac OS) is the following quote from the TN 2083 (in Daemon IPC Recommendations section).

Mach Considered Harmful
The Mach APIs represent the lowest level interface to the kernel. As such, they are the most likely to change as the system evolves. Apple has consistently recommended that third party developers avoid them. This applies to daemons and agents as it does to everything else.

However, in the case of daemons and agents, Mach APIs are particularly troublesome because you have to worry about bootstrap namespaces. While it's possible—some would even claim easy—to manage bootstrap namespaces correctly, it's better to just avoid the problem altogether by avoiding Mach APIs.

> The iOS SDK contains the Mach headers and all the relevant symbols,
> but that doesn't say anything about whether app review will reject
> your app for making Mach calls.
>
> FWIW, calling current_task() doesn't crash my app immediately. Perhaps
> I'm wrong about the strictness of Apple's policy on Mach usage.
>

current_task() is a macro that expands to mach_task_self which itself is a macro that expands to a global variable (mach_task_self_). There is few chance using it crashes your application ;-)

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

-- Jean-Daniel




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

This email sent to email@hidden

References: 
 >best way to divert callbacks to main thread from audio thread (From: Rich E <email@hidden>)
 >Re: best way to divert callbacks to main thread from audio thread (From: Paul Davis <email@hidden>)
 >Re: best way to divert callbacks to main thread from audio thread (From: Kyle Sluder <email@hidden>)
 >Re: best way to divert callbacks to main thread from audio thread (From: Paul Davis <email@hidden>)
 >Re: best way to divert callbacks to main thread from audio thread (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Timing issues with Realtime MIDI via Virtual MIDI Port
  • Next by Date: Re: Appended audio packets won't play back (IMA4)
  • Previous by thread: Re: best way to divert callbacks to main thread from audio thread
  • Next by thread: Re: best way to divert callbacks to main thread from audio thread
  • Index(es):
    • Date
    • Thread