-
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
-
一个有经验的书
一个比较老的好书-a veteran of the books
- 2023-04-20 04:20:03下载
- 积分:1
-
英飞凌XMC4000系列标准库
应用背景Infineon公司开发的XMC4000系列标准库。你可以使用这个库•编程。关键技术这是英飞凌XMC4000系列微控制器的标准库。这个库用C++语言写的。
- 2022-03-19 08:17:19下载
- 积分:1
-
实用的java习题,初学者可用
实用的java习题,初学者可用-Java practical exercises, beginners can be used
- 2023-01-10 00:56:11下载
- 积分:1
-
热键音量,主要用于系统的音量调节,是VB源码,全局热键的,可修心的!...
热键音量,主要用于系统的音量调节,是VB源码,全局热键的,可修心的!-hotkey volume, mainly for the volume, is VB source, the global hotkey, mind!
- 2022-02-28 18:04:34下载
- 积分:1
-
Digital tube display driver and the keyboard scan program and digital pipe
数码管显示驱动和键盘扫描的方案 及 数码管驱动及键盘控制芯片CH451中文手册。和相对应的程序。-Digital tube display driver and the keyboard scan program and digital pipe-driven and keyboard control chip CH451 Chinese manual. And the corresponding procedures.
- 2022-02-03 03:19:04下载
- 积分:1
-
算符优先分析器C语言版
算符优先分析器C语言版-operator priority Analyzer C language version
- 2022-01-25 23:27:10下载
- 积分:1
-
精美系统图标
精美系统图标-Fine system icon
- 2023-09-01 03:05:04下载
- 积分:1
-
this a basic adaboost program of Matlab. good for beginners
this a basic adaboost program of matlab. good for beginners-this a basic adaboost program of Matlab. good for beginners
- 2023-06-11 13:40:03下载
- 积分:1
-
这是我自己编写的 c++builder60环境下的
一个小程序,主要体现了人工智能里的A*宽度优先搜索...
这是我自己编写的 c++builder60环境下的
一个小程序,主要体现了人工智能里的A*宽度优先搜索-This is my own c builder60 prepared by the environment of a small procedure, mainly embodies the artificial intelligence Lane width of the A* search priority
- 2022-08-09 18:33:11下载
- 积分:1