-
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
-
OrangeHRM中文补丁包,是目前位置最全效果最好的补丁包
OrangeHRM中文补丁包,是目前位置最全效果最好的补丁包-OrangeHRM Chinese pack, which is the best location of the most full-patch package
- 2022-07-09 15:26:04下载
- 积分:1
-
Qt开发的基于NI Visa的仪器控制程序源码
Qt开发的基于NI Visa的仪器控制程序源码,通过本程序,你可以学习到如何使用Qt调用第三方dll。
- 2022-07-27 14:18:23下载
- 积分:1
-
AutoCAD多重拷贝命令。
命令名称:MulCopy
命令功能:本程序以代替AutoCAD中原有的Copy命令,当进行多重拷贝时,避免了使用Cop...
AutoCAD多重拷贝命令。
命令名称:MulCopy
命令功能:本程序以代替AutoCAD中原有的Copy命令,当进行多重拷贝时,避免了使用Copy命令时出现提示语需要键入“M”的烦琐。当不需继续多重拷贝时,可按回车或鼠标右键结束。-Multiple copies of AutoCAD commands. Command name: MulCopy command functions: This procedure to replace the Central Plains AutoCAD Some Copy command, when multiple copies, the Copy command to avoid the use of language when the need for prompt, type
- 2022-01-29 04:49:43下载
- 积分:1
-
在list box上添加图片,在combo box上添加图片
在list box上添加图片,在combo box上添加图片-In the list box to add a picture, in the combo box to add picture
- 2023-05-19 05:25:02下载
- 积分:1
-
Achieved a convolution coding and Viterbi decoding, but also a simple BPSK modul...
实现了卷积编码和维特比译码,也有简单的BPSK调制解调过程。-Achieved a convolution coding and Viterbi decoding, but also a simple BPSK modulation and demodulation process.
- 2022-01-31 01:09:18下载
- 积分:1
-
西门子PLC工程实例,为一个系统的PLC程序原文件,包含远程I/O站!...
西门子PLC工程实例,为一个系统的PLC程序原文件,包含远程I/O站!-Siemens PLC project examples for a system of PLC program original document, including remote I/O station!
- 2022-05-16 04:35:18下载
- 积分:1
-
THis C implelementation of Huffman s algorithm ..
it is good program ..
THis C implelementation of Huffman s algorithm ..
it is good program .. -THis is C implelementation of Huffman s algorithm ..
it is good program ..
- 2022-01-21 18:36:58下载
- 积分:1
-
所有剩余的磁盘空间覆盖后,完成自动删除…
全部磁盘剩余空间覆盖,完成后可自动删除,适用保密检查等-All the remaining disk space coverage is automatically deleted after the completion of applicable security inspection, etc.
- 2022-08-20 16:31:12下载
- 积分:1
-
超好玩的小游戏.里面有源程序,相关的工发说明
超好玩的小游戏.里面有源程序,相关的工发说明-super-fun little game. With a source, IDF related note
- 2022-02-15 23:57:01下载
- 积分:1