-
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
-
IFXdemo for vrtxsa86
IFXdemo for vrtxsa86-ifxdemo
- 2023-01-09 11:40:04下载
- 积分:1
-
Can be man
可以人机对弈、双人同机对弈,人机对弈电脑具有较好的人工智能算法,界面美观。开发工具:VC++6.0 和 MFC-Can be man-machine game, double game on the same plane, man-machine chess computer has a good artificial intelligence algorithms, attractive interface. Development Tools: VC++ 6.0 and MFC
- 2022-10-29 03:15:03下载
- 积分:1
-
一个3D火焰粒子效果,使用JSR184,效果很逼真
一个3D火焰粒子效果,使用JSR184,效果很逼真-Flame of a 3D particle effects, the use of JSR184, the effect is very realistic
- 2022-02-03 22:56:15下载
- 积分:1
-
酒店管理项目
Hotel management project
- 2022-05-26 15:42:57下载
- 积分:1
-
单机,网络多人对战俄罗斯方块,内有详细设计说明
单机,网络多人对战俄罗斯方块,内有详细设计说明-standalone, network multiplayer Tetris, with detailed design specifications
- 2022-05-08 16:17:46下载
- 积分:1
-
non
用非递归的方法先序遍历二叉树-non- recursive method preorder Binary Tree
- 2022-05-06 23:49:41下载
- 积分:1
-
Visual C++课程设计案例精编
Visual C++课程设计案例精编--通讯录-Visual C cases intensive curriculum design series-- directory
- 2022-02-07 03:51:35下载
- 积分:1
-
熟悉SQL设计软件的一般步骤、SQL的基本语法语句、辅助课堂教学为目的,提高同学的编程开发软件的能力,进一步巩固数据库课程...
熟悉SQL设计软件的一般步骤、SQL的基本语法语句、辅助课堂教学为目的,提高同学的编程开发软件的能力,进一步巩固数据库课程-familiar with the general design software steps, the basic syntax of SQL statements, support for teaching purposes, improve students programming software, database programs to further consolidate
- 2023-01-23 04:15:04下载
- 积分:1
-
数据结构与算法(c++)版源代码,很有用!
数据结构与算法(c++)版源代码,很有用!-Data Structures and Algorithms (c++) Version of the source code, very useful!
- 2023-01-10 19:55:02下载
- 积分:1