-
CoStream 无缓存 Pipe Stream
翻译 maninwest@Codeforge 作者:Sergey Nozhenko@CodeProject介绍:CoStream 是的 PipeStream 无缓存替代选择。背景在生产者/消费者模式下,如果我们知道一个消费者确定要读取stream 读到结束或者如果不能读到结束就处理,那么同步stream 就不需要维护自己的内部缓存,完全依赖于 Read 方法调用者的缓存。在Read 方法中,CoStream 保存到目标缓存的引用并等待,直至完成。而 write 方法从源缓存中复制数据到目标缓存,会给读取者发送信号缓存已准备就绪或者需要等待期 Read 调用(如果来源缓存中有未消耗的数据剩下或者返回到Writer 调用者)。使用代码CoStream 不能在单个话题中使用。应该至少有两个,读取和写入话题。两者都需要关闭(或处理)stream,一边对方可以继续到结束。测试程序在 XmlDocument 中加载了一些 xml 文件。然后将其写入到 CoStream 的实例Static CoStream costream = new TestCoStream();
static string outpath;
static void Main(string[] args)
{
// ...
XmlDocument doc = new XmlDocument();
doc.Load(args[0]);
outpath = args[1];
var reading_thread = new Thread(ReaderBody);
reading_thread.Start();
using (var pipe = XmlWriter.Create(costream, new XmlWriterSettings { CloseOutput = true }))
doc.Save(pipe);
reading_thre
- 2022-03-17 17:34:17下载
- 积分:1
-
一款经典的手机游戏HighSeas。文件包中包含java源码以及图片和音乐素材...
一款经典的手机游戏HighSeas。文件包中包含java源码以及图片和音乐素材-A classic mobile phone game HighSeas. Java file package contains the source material, as well as pictures and music
- 2022-11-25 11:05:03下载
- 积分:1
-
for many computer enthusiasts, not often can be installed with a computer, throu...
对许多电脑爱好者来说,并不是常常有计算机可以安装,其实通过日常的一些维护,你也可以学到许多DIY知识。我们在这里介绍一下,常用的一些简单的维护办法,希望能引起大家注意,制定出自己的电脑维护方案。-for many computer enthusiasts, not often can be installed with a computer, through some routine maintenance, you can learn a lot of DIY knowledge. We are here to tell us, usually some simple maintenance of way that can arouse the attention of Members to develop its own computer maintenance program.
- 2023-07-07 11:10:03下载
- 积分:1
-
LabVIEW实现对光谱数据的动态测量,这里是对不稳定的光谱数据进行动态测量...
LabVIEW实现对光谱数据的动态测量,这里是对不稳定的光谱数据进行动态测量-LabVIEW realize the dynamic measurement of spectral data, here is the unstable dynamic measurement of spectral data
- 2022-12-10 17:05:03下载
- 积分:1
-
雷达对抗原理 赵国庆Chapter5_radar_duikang_yuanli.rar
雷达对抗原理 赵国庆Chapter5_radar_duikang_yuanli.rar-radar confrontation principle Zhao Guoqing Chapter5_radar_duikang_yua nli.rar
- 2022-01-28 04:25:48下载
- 积分:1
-
BP算法的源代码,很多程序都是用MATLAB工具箱函数…
bp算法的源代码,由于很多程序都是利用matlab工具箱函数做的,不利于是用这个性化设计,对于观察网络内部的结构也带来一定困难,这个算法就可以让社记者跟踪训练过程-bp algorithm source code, a lot of procedures are using Matlab Toolbox function done, then use the negative nature of the design, the internal network for observation of the structure is also a certain difficulties, this algorithm can let reporters tracking the training process
- 2023-05-02 21:55:04下载
- 积分:1
-
Line follower robot using PIC 16F877A
直线跟随机器人是一种自主运输机器人。它是用16F877A实现的,用CCS编码编译器.CODE包括掉头、停止、转弯等命令。
- 2022-08-25 16:08:18下载
- 积分:1
-
单逆变器 3 级
一个简单的例子,全桥逆变器 PWM 调制三个层次使用筛选器类型散货拼箱来避免疾病重大电力线路
- 2022-08-16 19:22:27下载
- 积分:1
-
制作软盘镜像文件核心代码,希望对磁盘镜像学习者能有一定启示...
制作软盘镜像文件核心代码,希望对磁盘镜像学习者能有一定启示-floppy disk image file produced the core code, and I hope to disk mirroring learners can have a certain amount Inspiration
- 2022-07-18 14:53:32下载
- 积分:1
-
C语言课程设计
C语言课程设计--泊车管理
这是我们C语言课程设计的一个作业。-C language curriculum design parking management This is our C language curriculum design an operation.
- 2022-02-26 10:10:54下载
- 积分:1