qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: famz@redhat.com
Subject: Re: [Qemu-devel] [PATCH 4/5] coroutine-lock: make qemu_co_enter_next thread-safe
Date: Thu, 25 Jan 2018 14:15:27 -0600	[thread overview]
Message-ID: <de71ef60-9787-25fb-617e-5c139351c039@redhat.com> (raw)
In-Reply-To: <20180125175949.7780-5-pbonzini@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

On 01/25/2018 11:59 AM, Paolo Bonzini wrote:
> qemu_co_queue_next does not need to release and re-acquire the mutex,
> because the queued coroutine does not run immediately.  However, this
> does not hold for qemu_co_enter_next.  Now that qemu_co_queue_wait
> can synchronize (via QemuLockable) with code that is not running in
> coroutine context, it's important that code using qemu_co_enter_next
> can easily use a standardized locking idiom.
> 
> First of all, qemu_co_enter_next must use aio_co_wake to restart the
> coroutine.  Second, the function gains a second argument, a QemuLockable*,
> and the comments of qemu_co_queue_next and qemu_co_queue_restart_all
> are adjusted to clarify the difference.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---

>  /**
> - * Restarts all coroutines in the CoQueue and leaves the queue empty.
> + * Empties the CoQueue; all coroutines in it will run in FIFO orer as soon

s/orer/order/

> + * as the current one yields.
>   */
>  void coroutine_fn qemu_co_queue_restart_all(CoQueue *queue);


-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 619 bytes --]

  reply	other threads:[~2018-01-25 20:15 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 17:59 [Qemu-devel] [PATCH v3 0/5] coroutine-lock: polymorphic CoQueue Paolo Bonzini
2018-01-25 17:59 ` [Qemu-devel] [PATCH 1/5] test-coroutine: add simple CoMutex test Paolo Bonzini
2018-01-29 13:26   ` Stefan Hajnoczi
2018-01-25 17:59 ` [Qemu-devel] [PATCH 2/5] lockable: add QemuLockable Paolo Bonzini
2018-01-25 20:13   ` Eric Blake
2018-01-26  3:11   ` Fam Zheng
2018-01-26  5:24   ` Fam Zheng
2018-01-29 11:42   ` Stefan Hajnoczi
2018-01-29 14:30     ` Paolo Bonzini
2018-01-25 17:59 ` [Qemu-devel] [PATCH 3/5] coroutine-lock: convert CoQueue to use QemuLockable Paolo Bonzini
2018-01-29 13:26   ` Stefan Hajnoczi
2018-01-25 17:59 ` [Qemu-devel] [PATCH 4/5] coroutine-lock: make qemu_co_enter_next thread-safe Paolo Bonzini
2018-01-25 20:15   ` Eric Blake [this message]
2018-01-29 13:26   ` Stefan Hajnoczi
2018-02-01 15:28     ` Paolo Bonzini
2018-01-25 17:59 ` [Qemu-devel] [PATCH 5/5] curl: convert to CoQueue Paolo Bonzini
2018-01-29 13:27   ` Stefan Hajnoczi
2018-01-25 18:08 ` [Qemu-devel] [PATCH v3 0/5] coroutine-lock: polymorphic CoQueue no-reply
2018-01-25 20:31 ` Eric Blake
  -- strict thread matches above, loose matches on Subject: below --
2018-02-01 21:29 [Qemu-devel] [PATCH v4 " Paolo Bonzini
2018-02-01 21:29 ` [Qemu-devel] [PATCH 4/5] coroutine-lock: make qemu_co_enter_next thread-safe Paolo Bonzini
2018-02-03 15:39 [Qemu-devel] [PATCH v5 0/5] coroutine-lock: polymorphic CoQueue Paolo Bonzini
2018-02-03 15:39 ` [Qemu-devel] [PATCH 4/5] coroutine-lock: make qemu_co_enter_next thread-safe Paolo Bonzini
2018-02-03 20:57   ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=de71ef60-9787-25fb-617e-5c139351c039@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).