Thread-Communications

所属分类:按钮控件
开发工具:Java
文件大小:173KB
下载次数:8
上传日期:2013-12-30 10:15:32
上 传 者chenweiaiyanyan
说明:  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 (301, 2013-11-23)
Thread Communications\.fatjar (400, 2013-11-23)
Thread Communications\.project (415, 2013-11-25)
Thread Communications\.settings\org.eclipse.jdt.core.prefs (598, 2013-11-23)
Thread Communications\bin\Thread\8.jpg (84202, 2013-11-22)
Thread Communications\bin\Thread\TestThread$1.class (674, 2013-11-25)
Thread Communications\bin\Thread\TestThread$AddThread1.class (1309, 2013-11-25)
Thread Communications\bin\Thread\TestThread$AddThread2.class (1006, 2013-11-25)
Thread Communications\bin\Thread\TestThread$AddThread3.class (1254, 2013-11-25)
Thread Communications\bin\Thread\TestThread$ButtonListener.class (2800, 2013-11-25)
Thread Communications\bin\Thread\TestThread$ReduceThread1.class (1321, 2013-11-25)
Thread Communications\bin\Thread\TestThread$ReduceThread2.class (1021, 2013-11-25)
Thread Communications\bin\Thread\TestThread$ReduceThread3.class (1269, 2013-11-25)
Thread Communications\bin\Thread\TestThread.class (6046, 2013-11-25)
Thread Communications\src\Thread\8.jpg (84202, 2013-11-22)
Thread Communications\src\Thread\TestThread.java (6977, 2013-12-30)
Thread Communications\bin\Thread (0, 2013-12-30)
Thread Communications\src\Thread (0, 2013-12-30)
Thread Communications\.settings (0, 2013-12-30)
Thread Communications\bin (0, 2013-12-30)
Thread Communications\src (0, 2013-12-30)
Thread Communications (0, 2013-12-30)

近期下载者

相关文件


收藏者