Is there a reason why opening a device file (not a regular file) with numpy memmap should not work?
self.surface = np.memmap('/dev/fb1', dtype=np.uint16, mode='r+', shape=(320,240))
I work with a custom kernel module that adds a framebuffer device that works fine with the regular mmappython module . But using numpy seems to hang the kernel mutex when accessing the file system or something like that (I'm really not sure what exactly is happening).
My question here specifically is what numpy memmap cannot handle, and should I go the other way?
I asked another question about unix stackexchange , but it seems to me that these are two different questions, so I posted both of them.
Obviously this is on linux (kubuntu maverick with custom kernel module)
Update
Well, it turns out I can create memmap perfectly. The problem is that when I close the process without specifically closing the memmap object, it will just hang in the mutex in the kernel.
I don't know if this problem was with numpy, or my kernel module, or somewhere else.
source
share