-
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
-
simple clearance procedures, so is not perfect, please head examined!
简单的扫雷程序,做的还不是很完善,请站长审阅!-simple clearance procedures, so is not perfect, please head examined!
- 2023-05-30 10:00:02下载
- 积分:1
-
该文章介绍了在点云形式下的数据的孔和洞的检测算法。
该文章介绍了在点云形式下的数据的孔和洞的检测算法。-The article describes a cloud in the form of data and the hole-hole detection algorithm.
- 2022-03-22 05:35:45下载
- 积分:1
-
利用VB编写软件显示文件图标,可以为你的软件添加漂亮的图标。...
利用VB编写软件显示文件图标,可以为你的软件添加漂亮的图标。-VB document preparation software, and display icons, you can add software beautiful icon.
- 2022-11-26 21:05:03下载
- 积分:1
-
with FEKO simulation Yagi antenna, learning FEKO friends can familiarize ourselv...
用FEKO仿真的八木天线,学习FEKO的朋友可以熟悉一下-with FEKO simulation Yagi antenna, learning FEKO friends can familiarize ourselves
- 2023-02-12 05:10:04下载
- 积分:1
-
用VF所编的管理系统
用VF所编的管理系统-with VF prepared by the Management System
- 2022-06-13 13:35:31下载
- 积分:1
-
内部算法排序比较,按从小到大排序,快速算法,归并排序,冒泡排序等...
内部算法排序比较,按从小到大排序,快速算法,归并排序,冒泡排序等-Comparison of internal sorting algorithm, to sort by from small to large, fast algorithms, merge sort, bubble sort, etc.
- 2022-05-12 23:23:59下载
- 积分:1
-
Using C language interface in the game Snake game keyboard control to achieve th...
用C语言编写的贪吃蛇游戏 在游戏界面内实现键盘控制蛇吃豆的过程-Using C language interface in the game Snake game keyboard control to achieve the process of the snake to eat beans
- 2022-03-22 20:26:47下载
- 积分:1
-
PHP programming language, the mail routines PHP and MYSQL
PHP编程语言发邮件的例程 PHP+MYSQL-PHP programming language, the mail routines PHP and MYSQL
- 2022-05-17 00:58:04下载
- 积分:1
-
seg2数据格式,希望对于学相关数据格式的人有用
seg2数据格式,希望对于学相关数据格式的人有用-seg2 data format, data for the study were useful format
- 2023-08-25 15:40:03下载
- 积分:1