-
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
-
交织 本程序是自己编写的随机交织
可以实现任意维度 任意长度 的交织
比起其他的实现方法更具有 推广型...
交织 本程序是自己编写的随机交织
可以实现任意维度 任意长度 的交织
比起其他的实现方法更具有 推广型-Intertwined in this program is to prepare its own random interleaving can achieve any arbitrary length of the intertwined dimensions of the implementation is more than the other type has the extension
- 2022-12-30 23:10:03下载
- 积分:1
-
DSP2407 c编程用来实现一个基本的调试程序
DSP2407 c编程用来实现一个基本的调试程序-wheel c programming used to achieve a basic debugging procedures
- 2022-05-31 08:33:47下载
- 积分:1
-
第一次上载,先来个简单的贪吃蛇小游戏,C语言做的!初学作品!...
第一次上载,先来个简单的贪吃蛇小游戏,C语言做的!初学作品!-first on the first to a simple little game Snake, C language! Beginners works!
- 2022-07-13 02:28:51下载
- 积分:1
-
teach yourself C++ in 21 days
第五版
teach yourself C++ in 21 days
第五版-teach yourself C in the fifth edition of 21 days
- 2022-03-14 18:31:54下载
- 积分:1
-
用俄语编写的俄罗斯方块的游戏,我希望他们会提出自己的…
这是一个用c++编写的俄罗斯方块的游戏,希望大家能提出意见
-c prepared by the Russian box of the game and I hope they will put forward their views
- 2023-08-12 19:30:03下载
- 积分:1
-
Volterra滤波器混沌时间序列多步预测,预测效果好
Volterra滤波器混沌时间序列多步预测,预测效果好-Volterra filter for chaotic time series multi-step prediction to predict the effect of good
- 2023-05-23 09:35:03下载
- 积分:1
-
常见的地图操作和常用的功能实现(基本功能)
常见的地图操作和常用的功能实现(基本功能)-Common map operations and functions commonly used to achieve (basic function)
- 2022-03-21 19:57:05下载
- 积分:1
-
这是个用于内网抓包工具的使用介绍文档,希望给朋友们提供帮助。...
这是个用于内网抓包工具的使用介绍文档,希望给朋友们提供帮助。-it is used within the network to use the tools capturing Packet introduced documents, hope to the help of our friends.
- 2023-04-23 23:30:03下载
- 积分:1
-
本程序比较有趣,可以实现不用文件操作输出自己的代码
本程序比较有趣,可以实现不用文件操作输出自己的代码-this program more interesting, can not achieve their document output operation code
- 2022-01-26 05:42:03下载
- 积分:1