[Spice-devel] [RFC] server: add main_dispatcher

Hans de Goede hdegoede at redhat.com
Thu Sep 8 01:58:41 PDT 2011


Hi,

On 09/08/2011 09:31 AM, Gerd Hoffmann wrote:
> Hi,
>
>>> simple object system, not unions). Just an idea, could be changed
>>> later perhaps. socketpair is probably fine.
>>
>> First of all I see I forgot to add a mutex, since I said "any non main thread", right
>> now we only have one, so no need to lock, but the idea is that it can also be called from
>> others, and so we will need it later. (unless that write can be considered atomic, but
>> I don't think it can)
>
> A single write system call is atomic.

Yes and no, this is true, except when the write blocks after writing part of the
message, once that happens all bets are off. I think we may have several cases
where we don't check for this. At the minimum we should assert (and not ASSERT)
when a write returns a wrong number of bytes written (iow it managed
to write some but not all of the message).

Regards,

Hans


More information about the Spice-devel mailing list