CoreAudio和线程,如何?
我可以为 AU 回调(在 C 中)设置一个单独的线程吗?如何 ?如果是的话,什么线程方法最适合 CoreAudio? NSThreads? NSOperationQueue? GCD?还有别的事吗?
非常感谢。
can I set up a separate thread for an AU Callback (which is in C)? How ? If so what threads methods is best for CoreAudio? NSThreads? NSOperationQueue? GCD? Something else?
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你的 AU 回调不是已经在单独的线程中运行了吗?在大多数情况下,我会说让操作系统为您处理这个问题。 UI 始终应该位于主线程上,而 Core Audio 通常在另一个线程上执行其操作。
我只接触过 NSThread 和 pthreads,因为我在 GCD 和 NSOperationQueue 之前就开始使用,而且还没有机会了解它们是否以及如何与 Core Audio 一起工作。
Isn't your AU callback already running in a separate thread? In most cases, I'd say let the OS handle that for you. UI always should be on the main thread, while Core Audio typically does its stuff on another thread.
I've only had experience with NSThread and pthreads, since I started before GCD and NSOperationQueue, and haven't had a chance to see if and how they work with Core Audio.
不,这是不可能的,因为:
No, it is not possible, because: