qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/4] standalone libcacard
@ 2014-05-23 11:44 Paolo Bonzini
  2014-05-23 11:44 ` [Qemu-devel] [PATCH 1/4] glib-compat.h: add new thread API emulation on top of pre-2.31 API Paolo Bonzini
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Paolo Bonzini @ 2014-05-23 11:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, mjt

This series picks up Michael Tokarev's patches, avoiding the
nasty type redefinition for GMutex/GCond and also sticking to
the same API as glib 2.32+ (apart from the type name).

Keeping the same function names makes usage simpler, and is
type safe.

We could in principle drop QemuThread now that the API is the
same.  However:

- glib 2.32 also dropped custom thread implementations, which
  we may want sooner or later to use priority inheritance

- the POSIX implementation of GMutex is particularly inefficient
  (it is basically the same that we're doing here with GOnce) and uses
  malloc to get a pthread_mutex_t, with a little extra cost on each lock
  and unlock for the test and the pointer-chase.  It would be nicer if
  glib at least provided a futex-based implementation on Linux.

Comments?

Paolo

Michael Tokarev (4):
  glib-compat.h: add new thread API emulation on top of pre-2.31 API
  vscclient: use glib thread primitives not qemu
  libcacard: replace qemu thread primitives with glib ones
  libcacard: actually use symbols file

 coroutine-gthread.c   |   29 +++---------
 include/glib-compat.h |  119 +++++++++++++++++++++++++++++++++++++++++++++++++
 libcacard/Makefile    |   10 +---
 libcacard/event.c     |   23 ++++-----
 libcacard/vreader.c   |   18 +++----
 libcacard/vscclient.c |   70 +++++++++++++++--------------
 trace/simple.c        |   50 +++++----------------
 7 files changed, 195 insertions(+), 124 deletions(-)

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-06 13:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-23 11:44 [Qemu-devel] [PATCH 0/4] standalone libcacard Paolo Bonzini
2014-05-23 11:44 ` [Qemu-devel] [PATCH 1/4] glib-compat.h: add new thread API emulation on top of pre-2.31 API Paolo Bonzini
2014-05-23 15:03   ` Stefan Hajnoczi
2014-05-23 15:13     ` Paolo Bonzini
2014-05-23 15:24       ` Stefan Hajnoczi
2014-06-06 13:28   ` Stefan Hajnoczi
2014-05-23 11:44 ` [Qemu-devel] [PATCH 2/4] vscclient: use glib thread primitives not qemu Paolo Bonzini
2014-05-23 11:44 ` [Qemu-devel] [PATCH 3/4] libcacard: replace qemu thread primitives with glib ones Paolo Bonzini
2014-05-23 11:44 ` [Qemu-devel] [PATCH 4/4] libcacard: actually use symbols file Paolo Bonzini

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).