title: using numpy.memmap to map a device file
body: <p>Is there a reason that opening a device file (rather than a regular file) using numpy's memmap shouldn't work?</p>
  
  <pre><code>self.surface = np.memmap('/dev/fb1', dtype=np.uint16, mode='r+', shape=(320,240))
  </code></pre>
  
  <p>I'm working with a custom kernel module that adds a framebuffer device, which works fine with python's regular <code>mmap</code> module. But using numpy seems to hang the kernel's mutex on accessing the filesystem or something (I'm really not sure exactly what's happening).</p>
  
  <p>My question here is specifically is this something that numpy's memmap can't handle and I should go a different way?</p>
  
  <p>I've asked another question on <a href="https://unix.stackexchange.com/questions/7374/hung-system-call">unix stackexchange</a>, but I feel like it's 2 different questions so I've posted them both.</p>
  
  <p>Obviously this is on linux (kubuntu maverick with custom kernel module)</p>
  
  <p><strong>Update</strong>:</p>
  
  <p>Well, it turns out I can create the memmap fine. The problem it seems is that when I close the process without specifically closing the memmap object and it will just hang on the mutex in the kernel.</p>
  
  <p>I have no idea if this issue is with numpy, or my kernel module, or somewhere else.</p>