以循环缓冲区的方式从文件读取和写入 [英] Read and write from a file in a circular buffer fashion

查看:61
本文介绍了以循环缓冲区的方式从文件读取和写入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使文件表现为循环缓冲区.我必须从一个线程中写入数据,而从另一个线程中我已从文件中读取数据.但是文件的大小是固定的.

i need to make a file behave as a circular buffer. From one thread i have to write the data.From another thread i have read from the file. But the size of the file is fixed.

有什么主意吗?

推荐答案

您还可以考虑使用命名管道.

You could also consider using a named pipe.

这篇关于以循环缓冲区的方式从文件读取和写入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆