macos:Threads
出自UXGuide.net
请帮助我们修订和更新本文的中文部分
本文的中文部分虽然取自官方最新中文版本,但与英文原版相比已落后了一年多,可能无法反映英文版本中最近的修改,且文中笔误、前后译法矛盾、未翻译完全的片断较多,请您帮助一起修订完善。详情参见中文版修订完善计划。
线程
Threads
As you design your application, think about the operations that could be performed in parallel. Multithreading your application improves the responsiveness of your user interface by moving long calculations into separate threads and away from your main event loop. Multithreading can also improve the speed of performing some tasks, especially on multiprocessor systems. Of course, threading also requires great care during implementation to ensure that shared data structures are not corrupted by different threads. For more information on threading technologies, see Threading Programming Guide.
当您设计程序时,应该考虑哪些操作可以被并行的执行。将长时间的计算从主事件循环线程移到别的线程中,从而提高用户接口的响应速度。多线程同样能够提高一些任务的执行速度,特别是在多处理器系统中。当然,多线程同样要求在实现时仔细考虑共享数据的安全访问。关于线程的更多信息,请参考线程编程指南。