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

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

于 2022-03-26 发布 文件大小:22.26 kB
0 143
下载积分: 2 下载次数: 1

代码说明:

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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 依次执行一系列程序且每个程序之间执行有时间间隔。
    依次执行一系列程序且每个程序之间执行有时间间隔。- Carries out between in turn a series of procedures also each procedure carries out has the time-gap.
    2022-03-07 19:38:14下载
    积分:1
  • 一个使用C语言编写的模拟windows进程管理的程序,包括进程的创建,查看,替换,消息通信等等,我自己做的,非常精简...
    一个使用C语言编写的模拟windows进程管理的程序,包括进程的创建,查看,替换,消息通信等等,我自己做的,非常精简-a C language simulation windows process management procedures, including the process of creating, viewing, replacement, news communications, etc., I do, very concise
    2022-01-30 18:23:31下载
    积分:1
  • 多线程程序,多线程应用程序很容易发生。互斥对象的经验。
    多线程程序的编写,多线程应用中容易出现的问题。互斥对象的讲解,如何使用互斥对象来实现多线程的同步。如何利用命名互斥对象保证应用程序只有一个实例运行。应用多线程编写网络聊天室程序。-multithreaded program, multithreaded applications easily occur. Mutex object explain how to use the mutex object to the multi-thread synchronization. How to use object named mutex to ensure only one application program running examples. Application multithreaded network chat room preparation procedures.
    2022-01-26 07:59:42下载
    积分:1
  • Realize a multi
    一个用多线程实现文件查找的例子-Realize a multi-threaded file search example
    2022-07-16 06:39:59下载
    积分:1
  • Multithreading is a powerful tool, we can each time the need to implement the ma...
    多线程是一个功能强大的工具,我们可以在每次需要执行长时间运行的任务时使用该工具。我们可以用它运行辅助代码,而无需绑定用户界面。但同时要注意,多线程操作非常复杂,要正确操作并不容易,而且调试起来也比较困难。 尽管不一定能够实现,但我们还是应该尽量为每个辅助线程提供一组它可以操作的独立数据。要达到这个目的,最简单的方法就是为每个线程创建一个对象,对象中包含该线程可以操作的数据以及完成工作所需的代码。 通过实现结构化的架构,使之充当辅助线程和 UI 线程之间的媒介,我们可以大大简化编写多线程代码和 UI 以对其进行控制的过程。本文就介绍了这样一个架构,您可以根据需要使用或进行调整,以满足特定的应用需要。(附有详细的中文说明)-Multithreading is a powerful tool, we can each time the need to implement the mandate of running the use of this tool. We can use it for running auxiliary code, without the bundled user interface. It should be noted that multi-threaded operation is very complex to operate correctly is not easy, but it is also testing more difficult. Although not necessarily to achieve, but we should still try to provide every support threaded a group it can operate independent of data. To achieve this purpose, the simplest way is to create a thread for each object, object contains the thread can operate and the data necessary to complete the work of the code. Through the structure of the archit
    2023-06-08 19:10:04下载
    积分:1
  • c语言实现生产者消费者问题
    c语言实现生产者消费者问题-producer consumer issues
    2022-03-20 09:39:04下载
    积分:1
  • 先来先服务(FCFS)算法、短作业优先(SJF)算法、高响应比(HRN)算法和高优先权优先算法是作业调度中经常采用的,通过上述算法的模拟加深对作业控制快JCB的...
    先来先服务(FCFS)算法、短作业优先(SJF)算法、高响应比(HRN)算法和高优先权优先算法是作业调度中经常采用的,通过上述算法的模拟加深对作业控制快JCB的理解和作业调度过程的实现技巧-job jobjob jobjob jobjob jobjob jobjob jobjob jobjob jobjob job
    2022-08-14 08:21:04下载
    积分:1
  • 经典C程序源码,针对出学者哦!,希望对大家有帮助,希望大家多多上传啊...
    经典C程序源码,针对出学者哦!,希望对大家有帮助,希望大家多多上传啊-classic C program source code, up against scholars Oh! , And I hope to be helpful, I hope Members can upload ah
    2022-02-07 07:34:29下载
    积分:1
  • 演示了如何在一个程序当中去控制另一个程序的运行!从而实现自动化功能!...
    演示了如何在一个程序当中去控制另一个程序的运行!从而实现自动化功能!-demonstrated how, in a program to control the operation of another program! To achieve automation!
    2022-08-18 15:33:55下载
    积分:1
  • 这个程序是用SDK写的,很有意义,只不过一般人看不懂,现在没几能用SDK了...
    这个程序是用SDK写的,很有意义,只不过一般人看不懂,现在没几能用SDK了-the procedure is written with the SDK, interesting, but most people do not understand, right now the SDK can be used for
    2022-03-09 21:39:09下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载