文件名称:multitreadsrc4
- 所属分类:
- 进程与线程
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2008-10-13
- 文件大小:
- 22.25kb
- 下载次数:
- 0次
- 提 供 者:
- 苏**
- 相关连接:
- 无
- 下载说明:
- 别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容均来自于网络,请自行研究使用
线程的同步
虽然多线程能给我们带来好处,但是也有不少问题需要解决。例如,对于像磁盘驱动器这样独占性系统资源,由于线程可以执行进程的任何代码段,且线程的运行是由系统调度自动完成的,具有一定的不确定性,因此就有可能出现两个线程同时对磁盘驱动器进行操作,从而出现操作错误;又例如,对于银行系统的计算机来说,可能使用一个线程来更新其用户数据库,而用另外一个线程来读取数据库以响应储户的需要,极有可能读数据库的线程读取的是未完全更新的数据库,因为可能在读的时候只有一部分数据被更新过。-thread synchronization Although multithreading can bring us benefits, but there a lso many problems to be solved. For example, as disk drives such exclusivity system resources and can thread the process of implementation of any code, and the thread running by the scheduling system automatically and to a certain extent the uncertainty, So, then there could be two threads while the disk drives operate, which have operational errors; For example, For the computer banking system, may use a thread to update users of its database, and use another thread to read a database to respond to the needs of depositors, Reading is very likely to read threads database is not fully update the database, Reading may be because the time was only part of the updated data.
虽然多线程能给我们带来好处,但是也有不少问题需要解决。例如,对于像磁盘驱动器这样独占性系统资源,由于线程可以执行进程的任何代码段,且线程的运行是由系统调度自动完成的,具有一定的不确定性,因此就有可能出现两个线程同时对磁盘驱动器进行操作,从而出现操作错误;又例如,对于银行系统的计算机来说,可能使用一个线程来更新其用户数据库,而用另外一个线程来读取数据库以响应储户的需要,极有可能读数据库的线程读取的是未完全更新的数据库,因为可能在读的时候只有一部分数据被更新过。-thread synchronization Although multithreading can bring us benefits, but there a lso many problems to be solved. For example, as disk drives such exclusivity system resources and can thread the process of implementation of any code, and the thread running by the scheduling system automatically and to a certain extent the uncertainty, So, then there could be two threads while the disk drives operate, which have operational errors; For example, For the computer banking system, may use a thread to update users of its database, and use another thread to read a database to respond to the needs of depositors, Reading is very likely to read threads database is not fully update the database, Reading may be because the time was only part of the updated data.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : 81404621multitreadsrc4.rar 列表 MultiThread10\MultiThread10.cpp MultiThread10\MultiThread10.dsp MultiThread10\MultiThread10.dsw MultiThread10\MultiThread10.h MultiThread10\MultiThread10.rc MultiThread10\MultiThread10Dlg.cpp MultiThread10\MultiThread10Dlg.h MultiThread10\ReadMe.txt MultiThread10\res\MultiThread10.ico MultiThread10\res\MultiThread10.rc2 MultiThread10\Resource.h MultiThread10\StdAfx.cpp MultiThread10\StdAfx.h MultiThread9\MultiThread9.cpp MultiThread9\MultiThread9.dsp MultiThread9\MultiThread9.dsw MultiThread9\MultiThread9.h MultiThread9\MultiThread9.rc MultiThread9\MultiThread9Dlg.cpp MultiThread9\MultiThread9Dlg.h MultiThread9\ReadMe.txt MultiThread9\res\MultiThread9.ico MultiThread9\res\MultiThread9.rc2 MultiThread9\resource.h MultiThread9\StdAfx.cpp MultiThread9\StdAfx.h MultiThread10\res MultiThread9\res MultiThread10 MultiThread9