-
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
-
在LabVIEW里实现PLC中的下降沿触发的功能
在LabVIEW里实现PLC中的下降沿触发的功能-PLC in LabVIEW to achieve the falling edge trigger function
- 2023-07-20 10:55:03下载
- 积分:1
-
借助人家的东西哦!个人认为是非常不错的C语言例子程序,对于任何初学者来说,这都是非常好的教材!比学课本强多了...
借助人家的东西哦!个人认为是非常不错的C语言例子程序,对于任何初学者来说,这都是非常好的教材!比学课本强多了-with what others Oh! I think it is a very good example of the C language procedure for any newcomer, this is a very good teaching! Learning from textbooks is much easier.
- 2022-03-18 11:37:19下载
- 积分:1
-
delphi写的一款不错的通讯录软件,适合初学者下载.
delphi写的一款不错的通讯录软件,适合初学者下载.-delphi write a good address book software, suitable for beginners to download.
- 2022-03-01 23:05:46下载
- 积分:1
-
内存分配与回收,是用TC写的,请大家
内存分配与回收,是用TC写的,请大家-memory allocation and recovery, is TC wrote, please s
- 2022-10-29 09:25:04下载
- 积分:1
-
灰色预测的MATLAB程序,只要你将输入向量换成你的数据,结果、检验都出来了...
灰色预测的MATLAB程序,只要你将输入向量换成你的数据,结果、检验都出来了-Gray forecast MATLAB program, as long as you replace the input vector of your data, the results, testing all out. . .
- 2022-01-27 16:14:40下载
- 积分:1
-
usaco第1
USACO Section 1-4的后两个程序以及Section 1-5的全部程序代码-USACO Section 1-4 of the latter two procedures, as well as Section 1-5 of the full program code
- 2022-07-24 20:52:41下载
- 积分:1
-
College Information Management System
实例4学院信息管理系统 - RAR 档案文件-College Information Management System-RAR files
- 2022-01-22 07:58:27下载
- 积分:1
-
估计模型阶次的很有效的方法,调试通过,没有任何问题。
估计模型阶次的很有效的方法,调试通过,没有任何问题。-Estimated model order is very effective way to debug is passed, there is no problem.
- 2022-03-20 22:02:55下载
- 积分:1
-
excel VBA制作的扫雷游戏,初学EXCEL 编程的人可以下载
excel VBA制作的扫雷游戏,初学EXCEL 编程的人可以下载-excel VBA mine produced games, novice programming EXCEL can download
- 2022-06-18 08:08:37下载
- 积分:1