摘要:
面向过程与面向对象的本质区别 一位计算机界的大师曾说过,“我认为,面向对象的目标从来都不是复用和扩展,而是提供一种处理复杂问题的方法”。 面向过程讲究自顶向下逐步求精。找到一个系统的入口然后顺藤摸瓜,分析出每一步以及影响这一步的其他因素,我们就能够定义这个系统。 面向对象认为世界是有很多对象组成的, 阅读全文
摘要:
1)取消点的位置;耗时操作、大的业务逻辑; 2)取消后的资源释放。 pthread_cleanup_push 执行取消操作存在一定的危险。大多数危险都与完全恢复不变量和释放共享资源有关。取消线程时一定要格外小心,否则可能会使互斥保留为锁定状态,从而导致死锁状态。或者,已取消的线程可能保留已分配的内存 阅读全文
摘要:
Concurrency and Application Design In the early days of computing, the maximum amount of work per unit of time that a computer could perform was deter 阅读全文
摘要:
One of the technologies for starting tasks asynchronously is Grand Central Dispatch (GCD). This technology takes the thread management code you would 阅读全文
摘要:
Replacing Threads with Dispatch Queues To understand how you might replace threads with dispatch queues, first consider some of the ways you might be 阅读全文
摘要:
Dispatch Queues Dispatch queues are a C-based mechanism for executing custom tasks. A dispatch queue executes tasks either serially or concurrently bu 阅读全文