文件名称:Thread-Communications
-
所属分类:
- 标签属性:
- 上传时间:2013-12-30
-
文件大小:172.7kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
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
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
Thread Communications/.fatjar
Thread Communications/.project
Thread Communications/.settings/org.eclipse.jdt.core.prefs
Thread Communications/bin/Thread/8.jpg
Thread Communications/bin/Thread/TestThread$1.class
Thread Communications/bin/Thread/TestThread$AddThread1.class
Thread Communications/bin/Thread/TestThread$AddThread2.class
Thread Communications/bin/Thread/TestThread$AddThread3.class
Thread Communications/bin/Thread/TestThread$ButtonListener.class
Thread Communications/bin/Thread/TestThread$ReduceThread1.class
Thread Communications/bin/Thread/TestThread$ReduceThread2.class
Thread Communications/bin/Thread/TestThread$ReduceThread3.class
Thread Communications/bin/Thread/TestThread.class
Thread Communications/src/Thread/8.jpg
Thread Communications/src/Thread/TestThread.java
Thread Communications/bin/Thread
Thread Communications/src/Thread
Thread Communications/.settings
Thread Communications/bin
Thread Communications/src
Thread Communications
Thread Communications/.fatjar
Thread Communications/.project
Thread Communications/.settings/org.eclipse.jdt.core.prefs
Thread Communications/bin/Thread/8.jpg
Thread Communications/bin/Thread/TestThread$1.class
Thread Communications/bin/Thread/TestThread$AddThread1.class
Thread Communications/bin/Thread/TestThread$AddThread2.class
Thread Communications/bin/Thread/TestThread$AddThread3.class
Thread Communications/bin/Thread/TestThread$ButtonListener.class
Thread Communications/bin/Thread/TestThread$ReduceThread1.class
Thread Communications/bin/Thread/TestThread$ReduceThread2.class
Thread Communications/bin/Thread/TestThread$ReduceThread3.class
Thread Communications/bin/Thread/TestThread.class
Thread Communications/src/Thread/8.jpg
Thread Communications/src/Thread/TestThread.java
Thread Communications/bin/Thread
Thread Communications/src/Thread
Thread Communications/.settings
Thread Communications/bin
Thread Communications/src
Thread Communications
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.