delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2023/11/13/13:04:37

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D7D533861878
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1699898676;
bh=pEE8vWAbuePwxxFKeAaMD5NGutW7XstP6TA1gHL7q74=;
h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=BNOGVHwMDTTIlmKNh/Zjayw2tvGsEaK8ZJBQ26sxQf/pSdWJHTYFAJvseLu1yD0w8
2fRQhOF8CuaY007XCu4Cr4rVPogAfI/B8+LlRka6WNtMVJrO4WwLUsEIS7HZN4q5ii
etTNO2psIKcP5LysOGoNBqMrrEQOqyVT2SyV2lAI=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D22D03858C2F
ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D22D03858C2F
ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1699898662; cv=pass;
b=HR0o10k3HAfuWA+96HHqTxzJArWDf0B9VssOwn4GN2FQvBNoVRtPBMWC2Mn6rEjXGZuY7lQdZSyn8CUXpCJ/XzdY9m9tMo4xsISXdxYHVfdkiGezuX48OCUuURgpGaXHcjWO8hdCxQylf9V0zVIzfELPEI5Fd4VtM2LLWsAGdPo=
ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key;
t=1699898662; c=relaxed/simple;
bh=QgqthUSf3UdLZ+oQG1ZLloP0r6bMkl01+tqHeoAxQvA=;
h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID:
MIME-Version;
b=fo+FZPMQj5URTfGDT77yaOQ672vgeSSpuBA3/bWQC/FV2vOcnn6kIhYjkgQULPJ2G147ADBxs2ZT+jqStyjciQXlgKvvEeWuAlPq+Z6TtTJ5AD5BI+171XrkvK/hAKiothNclpordPA7MxsOZzt4atp57C5ZFo4qZuGK7fXz+cY=
ARC-Authentication-Results: i=2; server2.sourceware.org
ARC-Seal: i=1; a=rsa-sha256; t=1699898658; cv=none;
d=strato.com; s=strato-dkim-0002;
b=YTfvjCK1VfraHMWA8bTtn3iIjKFsMs7IFRhjDK7WSwq7dHDG2uRCWAaokTVAkm3OIy
3bxmkMhNfTufXORxETjrnx+eiKzW0jVfgqBxIT9NF6ZbCee1PEqqUcnNSKaFLvf8ztsr
JukC+yfkCzeDex4jnBFPBdfHq8zQJVX9G/xCdfWtQ/9T5heYu5+nPo9GUc4kOo+Aa1xC
pQ5aI/qmVFbdUN3fKGyAT7eAKOIVEqFmax9lNLIbc2Due1FP7n+2tpE2KzxHfWPX4IMj
GWJ0zqYzgfVJqwMmvApTuF+hce1TjuV0uACVmHYUphglyd+Q/MRbKmQ55Y0erYGiT9kJ
pqrQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1699898658;
s=strato-dkim-0002; d=strato.com;
h=References:In-Reply-To:Message-ID:Date:Subject:To:From:Cc:Date:From:
Subject:Sender;
bh=hYhkficf8FfF7n1LrOKcTASzrmqQzx6pnNoR64NViPw=;
b=Cx7FbnyDmHbJ/acm+1FbSFmd0ZRF75Wqj34A4fWCHa9C/r7/32tMxHSxH2DJbkb5dt
9XnVw1AyWjB0xL/eVhxGGnQjzteuHzDz2M8j3R5ZvTkMl13knzRlgl+LAVM83/HEnh3S
AHeD0uz/NHRfHfA87u96TRgFjNvNKhcbf0lvqaqkatFaCuxxIIi9T0c3joJ+ctQlggfZ
QJq3HjZ6xlT8+U1JrQGKcM6LxKDJpwkR1mXfyTjYFUHpSyzFvEjJZVdsKfmIrunMLYYz
9jwtneXQzt6TmUougACoVHBOBqU405IjPp9Aa/I1M6ibNYwrxmcsGsSjVFApB7lkG3jM
/KAg==
ARC-Authentication-Results: i=1; strato.com;
arc=none;
dkim=none
X-RZG-CLASS-ID: mo00
X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPEj6P3aAPjMxM7fbaFjXWSVIIF3Q=="
To: cygwin AT cygwin DOT com
Subject: Re: random is not multithread-safe in Cygwin
Date: Mon, 13 Nov 2023 19:04:18 +0100
Message-ID: <10013068.gMo3ACIZaO@nimes>
In-Reply-To: <ZVJK95e6p9ZTvR/P@calimero.vinschen.de>
References: <3811044 DOT 57xzQst1vy AT nimes> <ZVJK95e6p9ZTvR/P AT calimero DOT vinschen DOT de>
MIME-Version: 1.0
X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE,
RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_PASS, SPF_NONE, TXREP,
T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.30
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Bruno Haible via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Bruno Haible <bruno AT clisp DOT org>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

Corinna Vinschen wrote:
> > And indeed glibc, musl libc, AIX, Android, and even NetBSD implement it in a
> > multithread-safe way.
> 
> Our code is from FreeBSD, originally.  I checked the latest code from
> FreeBSD.  It doesn't lock anything in random() and generates the same
> error when running the same test app.
> 
> Why is that ok for FreeBSD?

It is not OK in FreeBSD, either. This is what I noted in the Gnulib manual:
https://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob;f=doc/posix-functions/random.texi

But it is MT-safe in NetBSD (in the '#ifndef SMALL_RANDOM' branch):
http://cvsweb.netbsd.org/bsdweb.cgi/src/common/lib/libc/stdlib/random.c?rev=1.7&content-type=text/x-cvsweb-markup

Bruno




-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019