On Tue, Sep 10, 2013 at 02:42:10PM -0500, Michael Roth wrote:
> Quoting Stefan Hajnoczi (2013-08-29 02:43:02)
> > On Thu, Aug 29, 2013 at 09:09:45AM +0800, Wenchao Xia wrote:
> > > 于 2013-8-28 16:49, Stefan Hajnoczi 写道:
> > > >On Wed, Aug 28, 2013 at 11:25:33AM +0800, Wenchao Xia wrote:
> > > >>>+v
Quoting Stefan Hajnoczi (2013-08-29 02:43:02)
> On Thu, Aug 29, 2013 at 09:09:45AM +0800, Wenchao Xia wrote:
> > 于 2013-8-28 16:49, Stefan Hajnoczi 写道:
> > >On Wed, Aug 28, 2013 at 11:25:33AM +0800, Wenchao Xia wrote:
> > >>>+void aio_context_release(AioContext *ctx)
> > >>>+{
> > >>>+qemu_mute
On Fri, Aug 30, 2013 at 3:24 PM, Paolo Bonzini wrote:
> Il 30/08/2013 11:22, Stefan Hajnoczi ha scritto:
>> On Thu, Aug 29, 2013 at 10:26:31AM +0200, Paolo Bonzini wrote:
>>> Il 27/08/2013 16:39, Stefan Hajnoczi ha scritto:
+void aio_context_acquire(AioContext *ctx)
+{
+qemu_mut
Il 30/08/2013 11:22, Stefan Hajnoczi ha scritto:
> On Thu, Aug 29, 2013 at 10:26:31AM +0200, Paolo Bonzini wrote:
>> Il 27/08/2013 16:39, Stefan Hajnoczi ha scritto:
>>> +void aio_context_acquire(AioContext *ctx)
>>> +{
>>> +qemu_mutex_lock(&ctx->acquire_lock);
>>> +while (ctx->owner) {
>>>
On Thu, Aug 29, 2013 at 10:26:31AM +0200, Paolo Bonzini wrote:
> Il 27/08/2013 16:39, Stefan Hajnoczi ha scritto:
> > +void aio_context_acquire(AioContext *ctx)
> > +{
> > +qemu_mutex_lock(&ctx->acquire_lock);
> > +while (ctx->owner) {
> > +assert(!qemu_thread_is_self(ctx->owner));
于 2013-8-27 22:39, Stefan Hajnoczi 写道:
> It can be useful to run an AioContext from a thread which normally does
> not "own" the AioContext. For example, request draining can be
> implemented by acquiring the AioContext and looping aio_poll() until all
> requests have been completed.
>
> The foll
Il 27/08/2013 16:39, Stefan Hajnoczi ha scritto:
> +void aio_context_acquire(AioContext *ctx)
> +{
> +qemu_mutex_lock(&ctx->acquire_lock);
> +while (ctx->owner) {
> +assert(!qemu_thread_is_self(ctx->owner));
> +aio_notify(ctx); /* kick current owner */
> +qemu_cond_w
On Thu, Aug 29, 2013 at 09:09:45AM +0800, Wenchao Xia wrote:
> 于 2013-8-28 16:49, Stefan Hajnoczi 写道:
> >On Wed, Aug 28, 2013 at 11:25:33AM +0800, Wenchao Xia wrote:
> >>>+void aio_context_release(AioContext *ctx)
> >>>+{
> >>>+qemu_mutex_lock(&ctx->acquire_lock);
> >>>+assert(ctx->owner &&
于 2013-8-28 16:49, Stefan Hajnoczi 写道:
On Wed, Aug 28, 2013 at 11:25:33AM +0800, Wenchao Xia wrote:
+void aio_context_release(AioContext *ctx)
+{
+qemu_mutex_lock(&ctx->acquire_lock);
+assert(ctx->owner && qemu_thread_is_self(ctx->owner));
+ctx->owner = NULL;
+qemu_cond_signal(&c
On Wed, Aug 28, 2013 at 11:25:33AM +0800, Wenchao Xia wrote:
> > +void aio_context_release(AioContext *ctx)
> > +{
> > +qemu_mutex_lock(&ctx->acquire_lock);
> > +assert(ctx->owner && qemu_thread_is_self(ctx->owner));
> > +ctx->owner = NULL;
> > +qemu_cond_signal(&ctx->acquire_cond);
The APIs look nice to me, have some minor comments.
> It can be useful to run an AioContext from a thread which normally does
> not "own" the AioContext. For example, request draining can be
> implemented by acquiring the AioContext and looping aio_poll() until all
> requests have been complet
于 2013-8-27 23:12, Paolo Bonzini 写道:
Il 27/08/2013 16:39, Stefan Hajnoczi ha scritto:
It can be useful to run an AioContext from a thread which normally does
not "own" the AioContext. For example, request draining can be
implemented by acquiring the AioContext and looping aio_poll() until all
r
--On 27 August 2013 16:39:45 +0200 Stefan Hajnoczi
wrote:
This patch implements aio_context_acquire() and aio_context_release().
Note that existing aio_poll() callers do not need to worry about
acquiring and releasing - it is only needed when multiple threads will
call aio_poll() on the sam
Il 27/08/2013 16:39, Stefan Hajnoczi ha scritto:
> It can be useful to run an AioContext from a thread which normally does
> not "own" the AioContext. For example, request draining can be
> implemented by acquiring the AioContext and looping aio_poll() until all
> requests have been completed.
>
It can be useful to run an AioContext from a thread which normally does
not "own" the AioContext. For example, request draining can be
implemented by acquiring the AioContext and looping aio_poll() until all
requests have been completed.
The following pattern should work:
/* Event loop thread
15 matches
Mail list logo