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

Alon Levy alevy at redhat.com
Thu Sep 8 02:18:46 PDT 2011


On Thu, Sep 08, 2011 at 10:58:41AM +0200, Hans de Goede wrote:
> 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).

Can that happen in a normal order of events? or is that a thing that really merits
crashing the process?

> 
> Regards,
> 
> Hans
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel


More information about the Spice-devel mailing list