From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 From: Giacomo Tesio Date: Mon, 24 Jul 2017 18:03:04 +0200 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary="001a113f2a0c9db1c20555125911" Subject: [9fans] double lock in proc.c Topicbox-Message-UUID: bfd2d75e-ead9-11e9-9d60-3106f5b1d025 --001a113f2a0c9db1c20555125911 Content-Type: text/plain; charset="UTF-8" In /sys/src/9/port/proc.c a comment state: /* * Expects that only one process can call wakeup for any given Rendez. * We hold both locks to ensure that r->p and p->r remain consistent. * Richard Miller has a better solution that doesn't require both to * be held simultaneously, but I'm a paranoid - presotto. */ (see https://github.com/0intro/plan9/blob/master/sys/src/9/port/proc.c#L882-L887) I'd like to know a bit more about Miller's solution as I'd like to simplify postnote. Any hint or source code? Giacomo --001a113f2a0c9db1c20555125911 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
In /sys/src/9/port/proc.c a comment state:
/*
* Expects that only one process can call wakeup for any given Rende= z.
* We hold both locks to ensure that r->p and p->r remain consis= tent.
* Richard Miller has a better solution that doesn't require bo= th to
* be held simultaneously, but I'm a paranoid - presotto.
*/=

(see https://github.com/0intro/plan9/blob/master/sys/s= rc/9/port/proc.c#L882-L887)

I'd like to know a bit mor= e about Miller's solution as I'd like to simplify postnote.
Any hint or source code?


Giacomo
--001a113f2a0c9db1c20555125911--