文件名称:sy4
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:697.96kb
-
已下载:1次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
线程的创建和同步控制
在windows2000的环境下,创建一个控制台进程,此进程创建两个并发线程,一个是读线程,另一个是写线程。这两个线程共享一个数组A,写线程对数组分别进行10次写操作,每次写操作对A的每个元素赋一个相同的值;读线程对数组分别进行10次读操作,每次读操作输出A中所有元素的值。写出相应代码,并分析运行结果。修改代码,使每次读写互斥,即每次对数组的写操作结束后才能进行写操作,反之亦然。-Thread creation and synchronization control in windows2000 environment, create a console process, this process creates two concurrent threads, one reading thread and the other is to write thread. The two threads share an array of A, write threads 10 respectively on the array write operation, each write operation on each element of A assigned a same value read the thread on the array were read for 10 times, each time operation output value of all elements in A. Write the corresponding code, and analyze the running results. Modify the code so that each read-write mutex, that is, write each of the array only after the end of write operations, and vice versa.
在windows2000的环境下,创建一个控制台进程,此进程创建两个并发线程,一个是读线程,另一个是写线程。这两个线程共享一个数组A,写线程对数组分别进行10次写操作,每次写操作对A的每个元素赋一个相同的值;读线程对数组分别进行10次读操作,每次读操作输出A中所有元素的值。写出相应代码,并分析运行结果。修改代码,使每次读写互斥,即每次对数组的写操作结束后才能进行写操作,反之亦然。-Thread creation and synchronization control in windows2000 environment, create a console process, this process creates two concurrent threads, one reading thread and the other is to write thread. The two threads share an array of A, write threads 10 respectively on the array write operation, each write operation on each element of A assigned a same value read the thread on the array were read for 10 times, each time operation output value of all elements in A. Write the corresponding code, and analyze the running results. Modify the code so that each read-write mutex, that is, write each of the array only after the end of write operations, and vice versa.
相关搜索: sy4
(系统自动生成,下载前可以参看下载内容)
下载文件列表
sy4
sy4/Debug
sy4/Debug/sy4.exe
sy4/Debug/sy4.ilk
sy4/Debug/sy4.pch
sy4/Debug/sy4.pdb
sy4/Debug/vc60.idb
sy4/Debug/vc60.pdb
sy4/Debug/线程完成.obj
sy4/sy4.dsp
sy4/sy4.dsw
sy4/sy4.ncb
sy4/sy4.opt
sy4/sy4.plg
sy4/线程完成.cpp
sy4/Debug
sy4/Debug/sy4.exe
sy4/Debug/sy4.ilk
sy4/Debug/sy4.pch
sy4/Debug/sy4.pdb
sy4/Debug/vc60.idb
sy4/Debug/vc60.pdb
sy4/Debug/线程完成.obj
sy4/sy4.dsp
sy4/sy4.dsw
sy4/sy4.ncb
sy4/sy4.opt
sy4/sy4.plg
sy4/线程完成.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.