From: "Daniel P. Berrange" <berrange@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Olivier Hainque" <hainque@adacore.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Ян Завадовский" <zavadovsky.yan@gmail.com>,
"Stefan Weil" <sw@weilnetz.de>,
"QEMU Developers" <qemu-devel@nongnu.org>,
"Fabien Chouteau" <chouteau@adacore.com>
Subject: Re: [Qemu-devel] [PATCH] thread-win32: fix GetThreadContext() permanently fails
Date: Tue, 23 Jun 2015 12:18:22 +0100 [thread overview]
Message-ID: <20150623111822.GE30318@redhat.com> (raw)
In-Reply-To: <55893923.9010304@redhat.com>
On Tue, Jun 23, 2015 at 12:46:59PM +0200, Paolo Bonzini wrote:
>
>
> On 23/06/2015 12:30, Peter Maydell wrote:
> > On 23 June 2015 at 10:55, Ян Завадовский <zavadovsky.yan@gmail.com> wrote:
> >> On Tue, Jun 23, 2015 at 9:02 AM, Stefan Weil <sw@weilnetz.de> wrote:
> >>> We should add an URL to reliable documentation which supports that
> >>> claim.
> >>
> >> Unfortunately, MSDN says only "SuspendThread suspends the thread. It's
> >> designed for debuggers. Don't use in applications.":
> >> https://msdn.microsoft.com/en-us/library/windows/desktop/ms686345(v=vs.85).aspx
> >> And nothing more useful.
> >> So when I found this piece of code with Suspend/Resume and failed GetContext
> >> I did some googling.
> >> And found this article:
> >> http://blogs.msdn.com/b/oldnewthing/archive/2015/02/05/10591215.aspx
> >
> > Personally I am happy to treat a Raymond Chen blog post as "reliable
> > documentation"...
>
> Me too. :)
>
> SuspendThread was pretty much the only way to emulate signals.
> Initially I used SetThreadContext to redirect execution to cpu_signal;
> that was more complicated, but in retrospect it would have avoided the
> problems with memory barriers and with asynchronous SuspendThread. It
> certainly would have saved the AdaCore people a lot of debugging time. :(
>
> For 2.5, however, I wonder if SuspendThread/ResumeThread is needed at
> all now that cpu_exit doesn't have to undo block chaining anymore. Even
> on POSIX platforms the signal might not be necessary anymore.
If you don't have that signal / SuspendThread/ResumtThread requirement,
might that enable QEMU to just depend on the winpthreads library that
is provided by Mingw project, and not bother reinventing the wheel for
thread library portabilty ?
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
next prev parent reply other threads:[~2015-06-23 11:18 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-22 21:54 [Qemu-devel] [PATCH] thread-win32: fix GetThreadContext() permanently fails Zavadovsky Yan
2015-06-23 6:02 ` Stefan Weil
2015-06-23 9:49 ` Fabien Chouteau
2015-06-23 10:11 ` Ян Завадовский
2015-06-23 9:55 ` Ян Завадовский
2015-06-23 10:30 ` Peter Maydell
2015-06-23 10:46 ` Paolo Bonzini
2015-06-23 11:18 ` Daniel P. Berrange [this message]
2015-06-23 11:32 ` Paolo Bonzini
2015-06-23 11:43 ` Daniel P. Berrange
2015-06-23 11:52 ` Paolo Bonzini
2015-06-23 11:23 ` Peter Maydell
2015-06-23 17:07 ` Stefan Weil
2015-06-24 9:09 ` Fabien Chouteau
2015-06-24 10:03 ` Peter Maydell
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=20150623111822.GE30318@redhat.com \
--to=berrange@redhat.com \
--cc=chouteau@adacore.com \
--cc=hainque@adacore.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
--cc=zavadovsky.yan@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.