文件名称:sy4
- 所属分类:
- 其他小程序
- 资源属性:
- [Windows] [Visual C] [源码]
- 上传时间:
- 2012-11-26
- 文件大小:
- 698kb
- 下载次数:
- 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
...\Debug
...\.....\sy4.exe
...\.....\sy4.ilk
...\.....\sy4.pch
...\.....\sy4.pdb
...\.....\vc60.idb
...\.....\vc60.pdb
...\.....\线程完成.obj
...\sy4.dsp
...\sy4.dsw
...\sy4.ncb
...\sy4.opt
...\sy4.plg
...\线程完成.cpp
...\Debug
...\.....\sy4.exe
...\.....\sy4.ilk
...\.....\sy4.pch
...\.....\sy4.pdb
...\.....\vc60.idb
...\.....\vc60.pdb
...\.....\线程完成.obj
...\sy4.dsp
...\sy4.dsw
...\sy4.ncb
...\sy4.opt
...\sy4.plg
...\线程完成.cpp