-
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
-
这是我业余做的一个学单车的小游戏,由于没有美工,图片用简单线条代替,需要安装directX,具体操作简单,游戏界面有介绍...
这是我业余做的一个学单车的小游戏,由于没有美工,图片用简单线条代替,需要安装directX,具体操作简单,游戏界面有介绍-This is my amateur done a study of small motorcycle games, in the absence of artists, pictures replaced with a simple lines need to install directX, the specific operation of a simple game interface is introduced
- 2022-12-29 01:20:04下载
- 积分:1
-
bp神经网络的C#编程
简单实用,方便利用,实现了BP神经网络在C#下的编程和学习,更加方便和利用。
- 2022-11-15 01:05:04下载
- 积分:1
-
USB协议的基础上和CH375芯片
USB 协议基础及ch375 usb芯片-USB protocol basis and ch375 usb chip
- 2022-03-25 20:43:56下载
- 积分:1
-
贪吃蛇 Win32 api 写的,只是抛砖引玉。
贪吃蛇 Win32 api 写的,只是抛砖引玉。-Snake Win32 api to write, only attract valuable comments.
- 2022-03-06 10:12:06下载
- 积分:1
-
一个调用具有输出参数的存储过程的小工程,喜欢就
一个调用具有输出参数的存储过程的小工程,喜欢就-Call a stored procedure with output parameters of the small-scale projects like the look
- 2023-07-05 23:20:03下载
- 积分:1
-
用C语言实现进程调度-操作系统课程设计设计思想:
“最高优先数优先”调度算法的基本思想是把cpu分配给就绪队列中优先数最高的进程。采用动态优先数,即优先数在...
用C语言实现进程调度-操作系统课程设计设计思想:
“最高优先数优先”调度算法的基本思想是把cpu分配给就绪队列中优先数最高的进程。采用动态优先数,即优先数在创建进程时给定一个初始值,当进程获得一次cpu后其优先数就减少1。-C language scheduling process-design courses on operating system design : "Priority number of the highest priority" scheduling algorithm the basic idea is cpu allocated to the parade were in place the highest priority in the process. Dynamic priority, which is priority number in the creation process to set an initial value, When the process is a cpu after its priority on reducing the number of one.
- 2022-05-25 04:15:05下载
- 积分:1
-
关于SNMP++的文章
关于SNMP++的文章-articles on SNMP
- 2022-07-09 06:34:00下载
- 积分:1
-
sdk下的俄罗斯方块 有游戏运行程序和源代码 并有详细的注解
sdk下的俄罗斯方块 有游戏运行程序和源代码 并有详细的注解-sdk the game Tetris is operational procedures and source code and a detailed explanation
- 2022-04-22 22:25:00下载
- 积分:1
-
the template documents of Software Engineering
the template documents of Software Engineering-the template documents of Software Engine ering
- 2022-12-11 19:30:03下载
- 积分:1