-
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
-
计算1到10以内的任意数(整数)的任意次幂
计算1到10以内的任意数(整数)的任意次幂-Of 1 to 10 within the calculation of an arbitrary number (integer) power of an arbitrary
- 2022-03-28 18:10:48下载
- 积分:1
-
建立在Matlab文本文件例如你可以在你的结果导出txt格式
creat text file in matlab for example you can export your result in txt format
- 2022-05-15 01:23:04下载
- 积分:1
-
一个非常简洁的截包工具,带有MD5加密分析功能,
一个非常简洁的截包工具,带有MD5加密分析功能,-a very simple tools of the latest package, with MD5 analysis functions,
- 2022-03-23 12:08:55下载
- 积分:1
-
本压缩文件是关于windows xp优化大师的七十项REG文件
本压缩文件是关于windows xp优化大师的七十项REG文件-the compressed files on the windows xp optimize the master document 70 REG
- 2023-01-03 23:05:04下载
- 积分:1
-
此书主要是讲Visual C++图形编程技巧与实例
此书主要是讲Visual C++图形编程技巧与实例
- 2022-05-25 04:38:59下载
- 积分:1
-
杭州电子科技大学期末考试试题,有参考价值
杭州电子科技大学期末考试试题,有参考价值-Hangzhou University of Electronic Science and the end of examination papers, a reference value
- 2022-03-17 13:30:39下载
- 积分:1
-
对游戏引擎有初步的认识!对开发游戏有很大的帮助作用
对游戏引擎有初步的认识!对开发游戏有很大的帮助作用-On the game engine has a preliminary understanding! On the development of the game has a lot of help
- 2022-01-31 03:03:27下载
- 积分:1
-
很好的hex文件格式转换为bin文件格式
很好的hex文件格式转换为bin文件格式-good hex file format conversion for the bin file format
- 2022-05-26 12:12:19下载
- 积分:1
-
这是使用j2me编写的连连看游戏,很精彩的哦。不信可以下来玩玩。...
这是使用j2me编写的连连看游戏,很精彩的哦。不信可以下来玩玩。-is prepared to use the 1000 block of Terry Avenue J2ME games, oh very good. Letters can not play down.
- 2022-12-04 21:35:02下载
- 积分:1