From a4380927eb2d0070a936666e90a979f0f258bb0f Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Thu, 27 Mar 2014 11:45:51 +1100 Subject: [PATCH] doc/go1.3.html: explain the change to the memory model LGTM=iant, rsc R=rsc, iant, mtj CC=golang-codereviews https://golang.org/cl/80260044 --- doc/go1.3.html | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/doc/go1.3.html b/doc/go1.3.html index 5d21ed6805..60861fb547 100644 --- a/doc/go1.3.html +++ b/doc/go1.3.html @@ -46,11 +46,12 @@ windows 2000 removed (CL 74790043)

Changes to the memory model

-TODO: -early go documentation suggested using a channel as a semaphore like this: (previous example). -the go memory model has been updated to make explicit that this idiom is allowed. (new example). -the previous example is also correct, just requiring needless func init work. -(CL 75130045) +The Go 1.3 memory model adds a new rule +concerning sending and receiving on buffered channels, +to make explicit that a buffered channel can be used as a simple +semaphore, using a send into the +channel to acquire and a receive from the channel to release. +This is not a language change, just a clarification about an expected property of communication.

Changes to the implementations and tools

-- 2.50.0