文件名称:Thread-Communications

  • 所属分类:
  • JSP源码/Java
  • 资源属性:
  • [Java] [源码]
  • 上传时间:
  • 2013-12-30
  • 文件大小:
  • 173kb
  • 下载次数:
  • 0次
  • 提 供 者:
  • che****
  • 相关连接:
  • 下载说明:
  • 别用迅雷下载,失败请重下,重下不扣分!

介绍说明--下载内容均来自于网络,请自行研究使用

1、  点“创建线程” 按钮,创建两个线程,一个线程不断对一个变量加1,结果显示在第一个文本框中。另一个线程不断对另一个变量减1,结果显示在第二个文本框中。这两个线程之间没有交互,仅用于演示线程的创建。

2、  演示线程互斥,点“线程互斥” 按钮,创建两个线程,一个线程不断循环,每次循环对共享变量x做100次加1操作(这100次加1操作作为一个临界区CSa),另一个线程不断循环,每次循环对共享变量x做100次减1操作(这100次减1操作作为一个临界区CSb),结果显示在第三个文本框中。可以看到结果是从0到100,然后又从100回到0。可见CSa和CSb两个临界区是互斥的。

3、  除了没有互斥,其它同2,结果显示在第四个文本框中。可见CSa和CSb两个临界区的执行是有交叉的,CSa的执行可能被CSb打断,CSb的执行也可能被CSa打断。

-1, point " create thread" button to create two threads, one thread plus a continuously variable showed that in the first text box. Another thread continuously variable minus one another, the results are displayed in the second text box. There is no interaction between the two threads, the thread is only for creating presentations. 2, demo thread mutex point " thread mutex" button to create two threads, one thread continuous cycle, each cycle of the shared variable x to do 100 plus an operation (this 100 plus an operation as a critical area CSa ), the cycle of another thread, the shared variables of each cycle do x 100 decremented (100 Save this as an operation of a critical section CSb), the results shown in the third text box. You can see the results from 0-100, and then from 100 back to 0. Visible CSa and CSb two critical areas are exclusive. 3, in addition to not mutually exclusive, the other with two, the results are displayed in the fourth text box. Visible execu
(系统自动生成,下载前可以参看下载内容)

下载文件列表





Thread Communications\.classpath

.....................\.fatjar

.....................\.project

.....................\.settings\org.eclipse.jdt.core.prefs

.....................\bin\Thread\8.jpg

.....................\...\......\TestThread$1.class

.....................\...\......\TestThread$AddThread1.class

.....................\...\......\TestThread$AddThread2.class

.....................\...\......\TestThread$AddThread3.class

.....................\...\......\TestThread$ButtonListener.class

.....................\...\......\TestThread$ReduceThread1.class

.....................\...\......\TestThread$ReduceThread2.class

.....................\...\......\TestThread$ReduceThread3.class

.....................\...\......\TestThread.class

.....................\src\Thread\8.jpg

.....................\...\......\TestThread.java

.....................\bin\Thread

.....................\src\Thread

.....................\.settings

.....................\bin

.....................\src

Thread Communications

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度更多...
  • 请直接用浏览器下载本站内容,不要使用迅雷之类的下载软件,用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.

相关评论

暂无评论内容.

发表评论

*主  题:
*内  容:
*验 证 码:

源码中国 www.ymcn.org