登录
首页 » 其他项目 » CoStream 无缓存 Pipe Stream

CoStream 无缓存 Pipe Stream

于 2022-03-17 发布 文件大小:5.32 kB
0 280
下载积分: 2 下载次数: 1

代码说明:

翻译 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

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • 经典扫雷程序,Visua C++ 6.0 环境下实现对于设置用户的青睐类对话框的配置...
    经典扫雷程序,Visua C++ 6.0 环境下实现对于设置用户的青睐类对话框的配置 -Copyright (c) 2004-2005 Micro-soft Module Name: DlgCustom.cpp Abstract: the class of Dialog for setting user s favor-config Author: Microsoft s Engineer- Unknown Name improved by Weijian Luo (Arthur Luo) 15-Jun-2005 E-mail: skybluehacker@yahoo.com.cn Revision History: 1.0
    2022-08-10 06:53:49下载
    积分:1
  • ArcGIS Engine primary example, vb prepared to adapt to beginners who want to lea...
    ArcGIS Engine的初级例子,vb编写,适应于初学者,对于想学习esri产品的初学者很有用处。-ArcGIS Engine primary example, vb prepared to adapt to beginners who want to learn ESRI products beginners useful.
    2022-05-17 17:48:22下载
    积分:1
  • BMP converted to ultra
    BMP转换为JGP源码,不使用第三方控件-BMP converted to ultra-source, non-use of third-party controls
    2022-06-29 07:21:18下载
    积分:1
  • 贪吃蛇的源代码,里面有比较好的12864液晶的显示代码。
    贪吃蛇的源代码,里面有比较好的12864液晶的显示代码。-Snake&39 s source code, which has a better LCD display of the code 12864.
    2022-03-15 07:18:01下载
    积分:1
  • Windows server 2003使用指南
    Windows server 2003使用指南-Windows 2003 server using the guidelines
    2022-03-22 18:49:50下载
    积分:1
  • K型热电偶的温度
    K型热电偶的温度--电压对照表啊。有新区可以看下 -K-type thermocouple temperature- ah voltage table. New facie there can be
    2022-02-24 21:12:42下载
    积分:1
  • DLL in the preparation process. Static and dynamic library of distinction, and t...
    动态链接库程序的编写。静态库与动态库的区别,以及调用程序在链接静态库和动态库时的区别。如何利用工具查看动态链接库输出的函数,Depends工具的使用,C++编译器名字改编技术对动态链接库输出函数的影响,extern "C"的用法,利用模块定义文件来解决C++名字改编的问题。用typedef定义指向函数的指针类型,如何获得动态连接库里的函数的指针。-DLL in the preparation process. Static and dynamic library of distinction, and the procedure call link static and dynamic library distinction. How to use the tool View DLL exporting the function Depends the use of tools C compiler technology adapted to name DLL function of the output, extern "C" for the usage, use module definition files to resolve the C adaptation of the name. Typedef definitions used at the function pointer type, how to obtain 13-17 Dynamic Link function of the target.
    2022-10-26 17:15:03下载
    积分:1
  • ingresar numerico teclado
    应用背景“命运对SER utilizado EN EL微controlador PIC16F873A,donde Ingresa UNA劈民é哥斯达黎加的Cuatro Dígitos,一个旅行é去联合国teclado Numé波多黎各波多黎各conectado Al,La que es procesada,Y的旅行éDE UNA pantalla LED conectada Al波多黎各C SE muestra Si La劈ES修正incorrecta啊。关键技术命运对utilizase席programa FUE和一微controlador PIC16F873A,EL阙tiene conectado联合国teclado de 4x4 conectado Al波多黎各Y尤娜•LED铝波多黎各C. EL板FUE armado关于联合国面包板的微procesadores PARA EL拉莫de de la Universidad TECNOLóGICA的大都会dictado埃尔塞贡多semestre德尔ñO 2014
    2022-03-07 16:43:15下载
    积分:1
  • ICcard
    IC卡小读写工具,读写工具.相信对某些人有用的-ICcard
    2022-05-07 05:14:02下载
    积分:1
  • awd bios文件的修改工具,用vc和vb制作
    awd bios文件的修改工具,用vc和vb制作-AWD bios document revision tool and vc production and vb
    2022-03-24 17:32:57下载
    积分:1
  • 696516资源总数
  • 106633会员总数
  • 4今日下载