是否可以访问用户空间中的内核空间缓冲区(只读模式) [英] Is it possible to access a kernel space buffer in user space (read only mode)

查看:81
本文介绍了是否可以访问用户空间中的内核空间缓冲区(只读模式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个用例,其中数据由驱动程序生成并存储在内核空间缓冲区中。在用户空间中,两个应用程序应同时使用此数据。是否有可能以某种方式将内核空间缓冲区分别映射到两个应用程序
的用户空间中,这样两者都可以在只读模式下"看到"数据。这样可以避免数据复制,因为预计缓冲区的大小非常大,而且缓冲区内容可能会非常快速地发生变化。

We have a use case where data is produced by the driver and stored in a kernel space buffer. In user space two applications should use this data simultaneously. Is it possible to somehow map the kernel space buffer into the user space of the two applications separately, such that both can 'see' the data in read only mode. This would avoid data copying, because the buffer is expected to be very large in size, and moreover the buffer contents are subject to change very fast.

推荐答案

是的,您可以这样做,请参阅
http://www.osronline.com/article上的文章。 cfm?article = 39
 (您必须注册才能看到它)。 只要这是真正的只读,这不是一件特别糟糕的事情,但是一旦你去读/写就会有很多问题。 确保
使用可以处理程序丢失的方法。

Yes you can do this, see the article at http://www.osronline.com/article.cfm?article=39 (you will have to register to see it).  As long as this is truly read only this is not a particularily bad thing to do, but there are a ton of problems once you go to read/write.  Be sure to use an approach that can handle the loss of the programs.


这篇关于是否可以访问用户空间中的内核空间缓冲区(只读模式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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