首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > 线程的同步   虽然多线程能给我们带来好处,但是也有不少问题需要解决。例如,对于像磁盘驱动器这样独占性系统资源,由于线程可以执行进程的任何代码段,且线程的运...

线程的同步   虽然多线程能给我们带来好处,但是也有不少问题需要解决。例如,对于像磁盘驱动器这样独占性系统资源,由于线程可以执行进程的任何代码段,且线程的运...

  • 资源大小:22.26 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签: Process-Thread

资 源 简 介

线程的同步   虽然多线程能给我们带来好处,但是也有不少问题需要解决。例如,对于像磁盘驱动器这样独占性系统资源,由于线程可以执行进程的任何代码段,且线程的运行是由系统调度自动完成的,具有一定的不确定性,因此就有可能出现两个线程同时对磁盘驱动器进行操作,从而出现操作错误;又例如,对于银行系统的计算机来说,可能使用一个线程来更新其用户数据库,而用另外一个线程来读取数据库以响应储户的需要,极有可能读数据库的线程读取的是未完全更新的数据库,因为可能在读的时候只有一部分数据被更新过。-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 dat

文 件 列 表

MultiThread9
res
MultiThread9.cpp
MultiThread9.dsp
MultiThread9.dsw
MultiThread9.h
MultiThread9.rc
MultiThread9Dlg.cpp
MultiThread9Dlg.h
ReadMe.txt
resource.h
StdAfx.cpp
StdAfx.h
MultiThread10
res
MultiThread10.cpp
MultiThread10.dsp
MultiThread10.dsw
MultiThread10.h
MultiThread10.rc
MultiThread10Dlg.cpp
MultiThread10Dlg.h
ReadMe.txt
Resource.h
StdAfx.cpp
StdAfx.h
VIP VIP
0.185738s