macos - Metal 如何创建工作线程?
问题描述
当我在程序中使用 Metal API 进行渲染时,我在 Time Profiler 中看到了几个工作线程:
8.00 ms 15.0% 0 s _dispatch_worker_thread2 0xcf325
8.00 ms 15.0% 0 s start_wqthread
8.00 ms 15.0% 0 s _pthread_wqthread
7.00 ms 13.2% 0 s _dispatch_workloop_worker_thread
6.00 ms 11.3% 0 s _dispatch_lane_invoke
6.00 ms 11.3% 0 s _dispatch_lane_serial_drain
6.00 ms 11.3% 0 s _dispatch_source_invoke
6.00 ms 11.3% 0 s _dispatch_continuation_pop
6.00 ms 11.3% 0 s _dispatch_client_callout
5.00 ms 9.4% 0 s -[_MTLCommandQueue _submitAvailableCommandBuffers]
1.00 ms 1.8% 0 s dispatch_mig_server
1.00 ms 1.8% 0 s _dispatch_event_loop_merge
1.00 ms 1.8% 0 s _dispatch_kevent_worker_thread
6.00 ms 11.3% 0 s _dispatch_workloop_worker_thread 0xcf31d
6.00 ms 11.3% 0 s start_wqthread
6.00 ms 11.3% 0 s _pthread_wqthread
6.00 ms 11.3% 1.00 ms _dispatch_workloop_worker_thread
5.00 ms 9.4% 0 s _dispatch_lane_invoke
5.00 ms 9.4% 0 s _dispatch_lane_serial_drain
5.00 ms 9.4% 0 s _dispatch_source_invoke
5.00 ms 9.4% 0 s _dispatch_continuation_pop
5.00 ms 9.4% 0 s _dispatch_client_callout
4.00 ms 7.5% 0 s -[_MTLCommandQueue _submitAvailableCommandBuffers]
1.00 ms 1.8% 0 s invocation function for block in CA::Context::client_port()
6.00 ms 11.3% 0 s _dispatch_workloop_worker_thread 0xcf31c
6.00 ms 11.3% 0 s start_wqthread
6.00 ms 11.3% 0 s _pthread_wqthread
6.00 ms 11.3% 1.00 ms _dispatch_workloop_worker_thread
5.00 ms 9.4% 0 s _dispatch_lane_invoke
5.00 ms 9.4% 0 s _dispatch_lane_serial_drain
5.00 ms 9.4% 0 s _dispatch_source_invoke
5.00 ms 9.4% 0 s _dispatch_continuation_pop
5.00 ms 9.4% 0 s _dispatch_client_callout
3.00 ms 5.6% 0 s -[_MTLCommandQueue _submitAvailableCommandBuffers]
2.00 ms 3.7% 0 s dispatch_mig_server
是否有可能知道为什么 Metal 会创建多个工作线程?
解决方案
推荐阅读
- javascript - OAuth 2:授权码和重定向
- node.js - 在节点 js 中使用 POST 方法时无法发布/错误
- android - ViewModel 在 java.lang.Class.newInstance 处没有零参数构造函数
- python - PYTHON - 使用自定义 MariaDB 连接器动态更新多个列
- python - 我怎样才能让我的代码正常工作?用户输入不适用于 if、elif 和 else
- python - 只为 pandas 中的一个条目选择第一个最大值
- google-chrome-extension - 用于执行点击和按键的 chrome 扩展的类 Selenium 框架
- flutter - 如何在flutter_map中获得点击位置?
- go - GitLab CI 和 Go 模块错误文件 .gitlab-ci.yml
- swift - 如何从 UIPasteboard.value(forPasteboardType: kUTTypePlainText) 获取字符串?