[PATCH wayland] shm: Allow deferred deletion of shared memory pools

Bill Spitzak spitzak at gmail.com
Tue Mar 31 11:59:10 PDT 2015


On 03/31/2015 11:26 AM, Derek Foreman wrote:
> Some compositors perform rendering in a separate thread.  If a client
> destroy occurs during rendering a segfault will occur when the client's
> shared memory pools are unmapped and the renderer continues to use them.

Is this thing correctly handling the event sent back to clients saying a 
buffer is no longer in use (ie it makes sure the parallel thread is not 
using the buffer before sending the event)?

> This adds a way (disabled by default) to queue shared memory pool deletion
> instead of performing it immediately, then the compositor can process
> the deletion list at a time that won't interfere with rendering.

I think it would be better to just have a pointer the compositor can 
change to the function to call to release the memory pool. Then the 
queue can be done entirely by the compositor that needs it. The 
compositor may also be able to do tests to see if it can delete 
immediately, or use mutexes to safely destroy stuff, or other ideas.


More information about the wayland-devel mailing list