[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets
From: |
Gleb Natapov |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets |
Date: |
Thu, 14 Oct 2010 11:19:37 +0200 |
On Thu, Oct 14, 2010 at 10:15:30AM +0100, Stefan Hajnoczi wrote:
> 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.
>
In Linux kernel you usually have two function cancel() and
cancel_sync(). Second variant waits for work completion.
--
Gleb.
- [Qemu-devel] v5 [PATCH 0/3] qemu: Threadlets: A generic task offloading framework, Arun R Bharadwaj, 2010/10/13
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Stefan Hajnoczi, 2010/10/14
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets,
Gleb Natapov <=
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Avi Kivity, 2010/10/14
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Venkateswararao Jujjuri (JV), 2010/10/14
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Avi Kivity, 2010/10/17
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Arun R Bharadwaj, 2010/10/18
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Avi Kivity, 2010/10/18
- Re: [Qemu-devel] [PATCH 1/3] Introduce threadlets, Stefan Hajnoczi, 2010/10/15
[Qemu-devel] [PATCH 2/3] Make paio subsystem use threadlets, Arun R Bharadwaj, 2010/10/13
[Qemu-devel] [PATCH 3/3] Add helper functions for virtio-9p to use threadlets, Arun R Bharadwaj, 2010/10/13