-
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
-
这是一个我的课后习题,要求编译一个酒店管理程序.做的不好~多多执教...
这是一个我的课后习题,要求编译一个酒店管理程序.做的不好~多多执教-This is one of my after-school exercises, a request compiler hotel management procedures. So many well-coached
- 2022-03-22 02:26:35下载
- 积分:1
-
无线接收模块c语言源程序 调试有效 C51
无线接收模块c语言源程序 调试有效 C51-RF1903-C51-RF1903-jieshou
- 2022-07-15 17:30:22下载
- 积分:1
-
PID控制是工程实际运用最多的控制器,此程序给出了用MATLAB设计控制器的基本程序,希望对大家有所帮助...
PID控制是工程实际运用最多的控制器,此程序给出了用MATLAB设计控制器的基本程序,希望对大家有所帮助-PID control is the most practical application of engineering controls, this procedure gives the controller design using MATLAB basic procedures, I hope all of you to help
- 2022-05-05 23:25:52下载
- 积分:1
-
DOS下进入Protect Mode,任意访问0
DOS下进入Protect Mode,任意访问0-4GB内存地址数据。-DOS into Protect Mode, random access memory address 0-4GB of data.
- 2022-02-14 01:37:57下载
- 积分:1
-
Frame2d Visual Basic 源代码
此.txt 包含完整的源代码的 frame2d.frm,将转换为.txt 文件。
Frame2d 是一个示例 (示例 8.2 要具体) 问题 介绍的有限元方法在工程 (第三版)
by Tirupathi R.Chandrupatla 和阿肖克 D.Belegundu .
请点击左侧文件开始预览 !预览只提供20%的代码片段,完整代码需下载后查看 加载中 侵权举报
- 2023-03-22 05:15:03下载
- 积分:1
-
在UNIX 下的C 原代码.查UNIX 下的系统时间。并取得时间的函数.
在UNIX 下的C 原代码.查UNIX 下的系统时间。并取得时间的函数.-under UNIX C source code. Investigation under the UNIX system time. And achieved a function of time.
- 2022-09-12 07:30:03下载
- 积分:1
-
A student s accomplishments are known to the array in this array failed to ident...
已知一个学生的成绩数组,在这个数组中找出其中有不及格课程的学生及其学生号-A student s accomplishments are known to the array in this array failed to identify which students and their student number
- 2023-08-17 20:55:02下载
- 积分:1
-
AEDK__51系列单片机仿真器_C51补丁........安装后即可用C
AEDK__51系列单片机仿真器_C51补丁........安装后即可用C-AEDK__51 Series MCU simulator _C51 patch available after the installation ........ C
- 2023-06-14 00:40:09下载
- 积分:1
-
本文档介c#下绍数组和集合的相关知识,对相关人员具有参考价值...
本文档介c#下绍数组和集合的相关知识,对相关人员具有参考价值-This document Shao Jie c# arrays and collections under the relevant knowledge, relevant personnel with the reference value for
- 2022-03-06 06:00:26下载
- 积分:1