-
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
-
WINCC design of the boiler water level
WINCC锅炉水位的设计,内容完整,可直接时刻直接学习使用-WINCC design of the boiler water level
- 2022-01-26 00:35:22下载
- 积分:1
-
OCR
ocr-optical character recognition-it is a very useful souece code for optical chARACTER recognition
- 2022-03-28 20:07:20下载
- 积分:1
-
11 bit dsp core data sheet
11 bit dsp core data sheet
- 2023-08-08 07:20:03下载
- 积分:1
-
作者自己编写的应用计算机串口同三菱fx系列plc通信的源程序
作者自己编写的应用计算机串口同三菱fx系列plc通信的源程序-prepared by the author himself computer serial port with Mitsubishi fx series plc communications source
- 2022-10-13 15:35:03下载
- 积分:1
-
Beamforming algorithm in MATLAB to achieve under the
波束形成算法在MATLAB下的实现源代码
-Beamforming algorithm in MATLAB to achieve under the
- 2023-01-25 15:05:03下载
- 积分:1
-
PHLILPS RC500 读写函数原代码
PHLILPS RC500 读写函数原代码
-PHLILPS RC500 original code reader function
- 2023-07-11 10:10:03下载
- 积分:1
-
AT24C02 such 24Cxx Series Universal I2C bus to read and write procedures
AT24C02等24CXX系列I2C通用总线读写程序-AT24C02 such 24Cxx Series Universal I2C bus to read and write procedures
- 2022-08-08 01:51:37下载
- 积分:1
-
chemical formula, chemical components exhaustive source code
化学式,化学分量穷举源代码-chemical formula, chemical components exhaustive source code
- 2022-01-29 00:54:40下载
- 积分:1
-
程序员的代码avrjtagflash仿真器仿真器的自我
avrjtagflash仿真器烧写代码用于自制作仿真器的烧录文件-programmer code avrjtagflash emulator emulator for the self-produced recording documentation
- 2022-07-14 17:28:16下载
- 积分:1