-
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
-
100M
100M-MAC-IPcore(从OPENCORE下载);-100M of the MAC
- 2023-02-17 12:05:04下载
- 积分:1
-
这是一个企业的论坛.我参与制作的.大家一起分享
这是一个企业的论坛.我参与制作的.大家一起分享-This is a business forum. I participated in the production. To share with everyone
- 2022-03-01 22:38:32下载
- 积分:1
-
A simple flash of fireworks
一个简单的烟花flash-A simple flash of fireworks
- 2022-03-26 03:14:14下载
- 积分:1
-
用MATLAB编程来实现语音信号中D比的计算,D比在说话人特征提取中有应用...
用MATLAB编程来实现语音信号中D比的计算,D比在说话人特征提取中有应用-MATLAB programming to voice signals over the D, D than in the Speaker feature extraction Applications
- 2023-01-20 08:00:04下载
- 积分:1
-
Using STL to achieve the basic functions of the Snake, concise algorithm, have r...
用STL实现了贪吃蛇的基本功能,算法比较精练,有参考价值-Using STL to achieve the basic functions of the Snake, concise algorithm, have reference value
- 2022-01-24 09:32:39下载
- 积分:1
-
关于人脸检测识别的英文论文,希望对你们有帮助!
关于人脸检测识别的英文论文,希望对你们有帮助!-?赜谌肆 ????馐 ??鸬挠 ?文论文, ??望 ?阅忝怯??镏?
- 2022-07-15 18:44:27下载
- 积分:1
-
c语言版贪吃蛇,想要的就快来下载把,
这是早期作品,很有收藏价值...
c语言版贪吃蛇,想要的就快来下载把,
这是早期作品,很有收藏价值-c language version of Snake, want to hurry download put on, it is early works, great value to the collection!
- 2022-01-22 07:31:33下载
- 积分:1
-
2.0G频率计的制作全过程
是pdf格式的
2.0G频率计的制作全过程
是pdf格式的-2.0G frequency of the entire process of production is a pdf format
- 2023-03-05 14:55:03下载
- 积分:1
-
How to modify file date
如何修改文件日期访问、修改上次访问
- 2023-01-09 19:00:04下载
- 积分:1