qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets
Date: Thu, 14 Oct 2010 10:15:30 +0100

I forgot to add that the semantics of cancellation make it difficult
to write correct user code.  Every cancellation user needs to add
extra synchronization after the cancel call to handle the case where
the work is currently executing.

This seems tricky to me and I suspect code using this interface will
be buggy.  How about the following?
1. Add a return value indicating that the work is currently executing
(this still requires the caller to add extra synchronization but is at
least explicit) versus work is no longer on the list.
2. Add a flag to block until the work has been cancelled or completed.
 This is useful to callers who are allowed to block.

Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]