On 24/03/21 17:15, Stefan Hajnoczi wrote:
On Wed, Mar 17, 2021 at 07:00:11PM +0100, Paolo Bonzini wrote:
+static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock)
+{
+CoRwTicket *tkt = QSIMPLEQ_FIRST(&lock->tickets);
+Coroutine *co = NULL;
+
+/*
+ * Setting lock->owners here pre
On Wed, Mar 17, 2021 at 07:00:11PM +0100, Paolo Bonzini wrote:
> +static void qemu_co_rwlock_maybe_wake_one(CoRwlock *lock)
> +{
> +CoRwTicket *tkt = QSIMPLEQ_FIRST(&lock->tickets);
> +Coroutine *co = NULL;
> +
> +/*
> + * Setting lock->owners here prevents rdlock and wrlock from
>
An invariant of the current rwlock is that if multiple coroutines hold a
reader lock, all must be runnable. The unlock implementation relies on
this, choosing to wake a single coroutine when the final read lock
holder exits the critical section, assuming that it will wake a
coroutine attempting to
On Wednesday, 2021-03-17 at 18:19:58 +01, Paolo Bonzini wrote:
> On 17/03/21 16:17, David Edmondson wrote:
>>> +if (tkt) {
>>> +if (tkt->read) {
>>> +if (lock->owners >= 0) {
>>> +lock->owners++;
>>> +co = tkt->co;
>>> +}
>>> +
On 17/03/21 16:17, David Edmondson wrote:
+if (tkt) {
+if (tkt->read) {
+if (lock->owners >= 0) {
+lock->owners++;
+co = tkt->co;
+}
+} else {
+if (lock->owners == 0) {
+lock->owners = -1;
+
On Wednesday, 2021-03-17 at 13:16:39 +01, Paolo Bonzini wrote:
> An invariant of the current rwlock is that if multiple coroutines hold a
> reader lock, all must be runnable. The unlock implementation relies on
> this, choosing to wake a single coroutine when the final read lock
> holder exits the
An invariant of the current rwlock is that if multiple coroutines hold a
reader lock, all must be runnable. The unlock implementation relies on
this, choosing to wake a single coroutine when the final read lock
holder exits the critical section, assuming that it will wake a
coroutine attempting to