delphi 多线程编程参考
Threads should not alter the semantics of a program. They simply change the timing of operations. As a result, they are almost always used as an elegant solution to performance related problems. Here are some examples of situations where you might use threads: * Doing lengthy processing: When a windows application is calculating it cannot process any more messages. As a result, the display cannot be updated. * Doing background processing: Some tasks may not be time critical, but need to execute continuously. * Doing I/O work: I/O to disk or to network can have unpredictable delays. Threads allow you to ensure that I/O latency does not delay unrelated parts of your application. All of these examples have one thing in common: In the program, some operations incur a potentially large delay or CPU hogging, but this delay or CPU usage is unacceptable for other operations; they need to be serviced now. Of course there are other miscellaneous benefits, and here they are: * Making use of multiprocessor systems: You can't expect one application with only one thread to make use of two or more processors! Chapter 3 explains this in more detail. * Efficient time sharing: Using thread and process priorities, you can ensure that everyone gets a fair allocation of CPU time. The wise use of threads turns slow, clunky, not very responsive programs into crisply responsive, efficient, fast programs, and can radically simplify various performance and usability problems.
- 1
- 粉丝: 4
- 资源: 2
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助