-
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
-
Data structure (C language version), Tsinghua University Press, chap Courseware
数据结构(C语言版)清华大学出版社第一章课件-Data structure (C language version), Tsinghua University Press, chap Courseware
- 2023-05-02 04:00:03下载
- 积分:1
-
particular contact Embedded operating system just friends do not know how the sy...
特别是刚刚接触嵌入式操作系统的朋友们不知道如何进行系统的安装及调试,为此我结合自己使用的切身体会,谈一谈它的安装及调试问题,希望对大家能起到一定的帮助作用-particular contact Embedded operating system just friends do not know how the system installation and debugging, Therefore, I have to use the light of their own personal experiences to talk about its installation and debugging. we can hope to play a helpful role
- 2022-04-30 15:29:50下载
- 积分:1
-
a power real
一个电力实时监控系统的VC实现,可以以此为参照进行进一步开发。-a power real-time monitoring system VC, be used as a reference for further development.
- 2022-06-26 04:55:29下载
- 积分:1
-
这个程序,主要用搅拌站混泥土的应用。重量仪表程序。比较全面,已经实际使用过。并取得了好的成绩。blackdisc5@sina.com
密码:1234...
这个程序,主要用搅拌站混泥土的应用。重量仪表程序。比较全面,已经实际使用过。并取得了好的成绩。blackdisc5@sina.com
密码:1234-this process, the main mixing station These projects applications. Weight instrument procedures. More comprehensive, practical use. And achieved good results. Blackdisc5@sina.com Password : 1234
- 2023-04-06 12:45:06下载
- 积分:1
-
IEC闪变测试
IEC闪变测试系统 基于MATLAB 实现 SIMULINK-IEC flicker test
- 2022-05-22 15:38:29下载
- 积分:1
-
CT仿真源代码
基于Shepp_Logan编写的
CT仿真源代码
基于Shepp_Logan编写的-CT-based simulation of the source code written Shepp_Logan
- 2022-09-05 10:10:03下载
- 积分:1
-
micro avr program
你好,朋友,我写的13个程序为微控制器avr与代码viosion完整的代码测试和附加十六进制文件。你可以使用它
- 2022-01-25 18:36:31下载
- 积分:1
-
一套小型的hospital系统,
一套小型的hospital系统, -A small hospital systems,
- 2023-08-18 06:20:04下载
- 积分:1
-
基于蜜蜂群的数值优化设计
AN IDEA BASED ON HONEY BEE SWARM FOR NUMERICAL OPTIMIZATION
- 2022-01-21 22:58:28下载
- 积分:1