[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 0/4] standalone libcacard
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 0/4] standalone libcacard |
Date: |
Fri, 23 May 2014 13:44:53 +0200 |
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(-)