[RFC wayland 1/2] server: implement intact resources

Giulio Camuffo giuliocamuffo at gmail.com
Mon Mar 23 04:22:00 PDT 2015


2015-03-23 12:00 GMT+02:00 Marek Chalupa <mchqwerty at gmail.com>:
> Destroyed seems confusing to me too, since the resource is not really
> destroyed. What about inert or unalive ?

Inert is ok, imho. On the client side they are called zombie
objects... maybe for consistency it'd be better to keep that here too.

>
> On Thu, Mar 19, 2015 at 2:34 PM, Bill Spitzak <spitzak at gmail.com> wrote:
>>
>> I think the name "intact" is really confusing. Can it be instead called
>> "destroyed"?
>>
>>
>> On 03/19/2015 01:11 AM, Marek Chalupa wrote:
>>>
>>> When server looses some capability (like pointer or keyboard),
>>> it takes some time to get this information to clients.
>>> When client sends request with new_id argument to the object
>>> that has been just destroyed on server-side (client
>>> does not know about it yet), we still have to create the resource.
>>> If we wouldn't do it then the client will get invalid id error once it
>>> tries to use the new object. But if we create it, then we have to
>>> take care that all the requests but destructor are ignored,
>>> because we do not have the server-side object anymore.
>>> (eventually, client will destroy the resource, because
>>> it will get the information about server-side object destruction)
>>>
>>> This patch solves this ugly race by adding wl_resource_set_intact()
>>> function that marks the resource as intact. When resource is intact
>>> it ignores all requests and events but destructors. The trick is in
>>> adding flag into the request's siganture that says: "hey! I'm
>>> destructor". Server then can skip non-destructor actions on intact
>>> resource.
>>>
>>> Programmer then can mark newly created resource as intact when
>>> this race come up instead of defining new implementation of
>>> resource just for this rare case.
>>
>>
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>


More information about the wayland-devel mailing list