OK, let’s see if we can untangle this.
Ken wrote:
Except the Mach interfaces are not "supported".
Mach APIs are supported, in the sense that:
they’re in the headers in the public SDK
App Review won’t reject you for using them
DTS will answer questions about them
With regards the last point, most of the time DTS’s answer will be “use some higher-level API” but, if what you’re doing can only be accomplished using Mach APIs, we can take things from there.
As such, they are subject to non-binary-compatible changes.
Ultimately all APIs can be subject to “non-binary-compatible changes”, depending on the context (ask any Carbon developer )-: The point here is that, due to their low-level nature, and the fact that most apps use higher-level APIs, Mach APIs are more susceptible to that than other APIs.
zacho wrote:
For example,
vm_allocate
,
mach_absolute_time
,
thread_policy_set
are part of Mach, but used ubiquitously.
This is an interesting spread. Let’s take each in turn:
Well if pthreads are built using Mach threads, might as well just use Mach threads.
That’s definitely the wrong approach to take with Mach APIs. You should use high-level APIs unless there’s a really good reason to use the Mach ones.
In the specific case of threads, pthreads brings a lot to the picture, including:
CPU architecture independence
consistency for higher-level code (lots of high-level frameworks assume that the calling thread is known to pthreads, which isn’t the case if you start it directly from Mach).
IMO starting a Mach thread directly is crazy talk! (-:
Finally, if you’re tinkering around with low-level aspects of the system I have two suggestions for you:
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"