From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 14 Sep 2011 19:51:55 +0200 Message-ID: From: Francisco J Ballesteros To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] NIX 64-bit kernel is available Topicbox-Message-UUID: 1db771fc-ead7-11e9-9d60-3106f5b1d025 futexes do not promise to behave like actual semaphores the last time I checked them out. These ones do. But the main difference is not that. They come with a semalt() op that tries to do a down at the same time on a set of semaphor= es. So, if you model tubes (nix channels) as a regular producer-consumer with two semaphores (one for holes one for messages), you can alt them by relying on semalt. If you are lucky, you don=C2=B4t enter the kernel. If yo= u are not, you do, but at least you get the semantics you=C2=B4d expect for a semaphor= e. On Wed, Sep 14, 2011 at 7:32 PM, David Leimbach wrote: > >> >> - Optimistic semaphores, a new type of semaphore which lives half in >> and half out of the kernel, and which in many cases will never run in >> kernel > > How is this both like and not like a futex? >