-
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
-
学习LabVIEW时做的书上的例程,课供初学者参考
学习LabVIEW时做的书上的例程,课供初学者参考-When learning LabVIEW book on the routines, classes for beginners reference
- 2022-01-25 23:07:34下载
- 积分:1
-
从麻省理工学院的“电路图”编辑!
SUE from MIT for schematic edit!
- 2022-11-07 18:05:04下载
- 积分:1
-
C++Builde做的俄罗斯方块源程序
C++Builde做的俄罗斯方块源程序-C Builde do Tetris source
- 2022-08-09 16:08:18下载
- 积分:1
-
能放大部分屏幕可以用来擦看一些很小的字或图片上的细节
能放大部分屏幕可以用来擦看一些很小的字或图片上的细节-Can enlarge part of the screen can be used to rub a small word or a look at some details of the pictures
- 2022-11-03 06:25:03下载
- 积分:1
-
使用微控制器 ic 测试仪
项目用途电路来测试所有的 ic 的使用的微控制器和完整的代码块中提到的不同的电子组件。主要用于测试 74 系列 IC 的此项目
- 2022-02-04 01:26:11下载
- 积分:1
-
修改后的PCA进行人脸识别的Matlab代码
修改后的PCA进行人脸识别的Matlab代码
-Revised PCA for Face Recognition Matlab code
- 2022-02-12 16:51:01下载
- 积分:1
-
电子秤通用数据采集数据。
我相信能给你带来不少的惊喜,希望你能留下你的姓名。...
电子秤通用数据采集数据。
我相信能给你带来不少的惊喜,希望你能留下你的姓名。-Electronic Scale generic data acquisition data. I believe that would give you a lot of surprises, I hope you can leave your name.
- 2023-07-29 16:50:03下载
- 积分:1
-
生成一个高斯水印后,对待嵌入水印的载体图像进行二维的DCT变换,然后嵌入水印...
生成一个高斯水印后,对待嵌入水印的载体图像进行二维的DCT变换,然后嵌入水印-Generates a Gaussian watermark, the watermark embedded in the carrier to treat two-dimensional image of the DCT transform, and then embedding the watermark
- 2022-03-25 18:46:23下载
- 积分:1
-
c++, 关于字符串探讨
c++, 关于字符串探讨-c, on the string on
- 2022-03-04 11:37:29下载
- 积分:1