简体   繁体   English

非常大的10G缓冲区的c ++ FIFO实现

[英]c++ FIFO implementation for VERY LARGE 10G buffer

I have a need to implement a 10G ring buffer (FIFO). 我需要实现10G环形缓冲区(FIFO)。 I need to write this program in C++ for integration (have to integrate with C++ API) reasons even though I think it will be easier in Java with it's FileChannel class. 由于集成(必须与C ++ API集成)的原因,我需要用C ++编写此程序,尽管我认为使用FileChannel类在Java中会更容易。 I know I'll need to use a memory-mapped file, just not sure how to do it in C++. 我知道我需要使用一个内存映射文件,只是不确定如何在C ++中做到这一点。 I figure I'll have to use a buffer and re-map it for different parts of the underlying file? 我想我必须使用缓冲区并将其重新映射到基础文件的不同部分? Something like that. 这样的事情。 Anyway, if anyone has some example code (non MFC), that would be great. 无论如何,如果有人有一些示例代码(非MFC),那就太好了。

I'll be implementing this on 32 bit hardware running Windows 7 32 bit. 我将在运行Windows 7 32位的32位硬件上实现此功能。

Thanks. 谢谢。

One way to create a memory mapped file, that works both on Windows and UNIX, is to use the Boost C++ libraries, see here . 创建在Windows和UNIX上均可使用的内存映射文件的一种方法是使用Boost C ++库,请参见此处 This code handles large files (> 4 GB) on most 32-bit platforms; 该代码在大多数32位平台上处理大文件(> 4 GB)。 see here . 这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM