From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aye.elm.relay.mailchannels.net (aye.elm.relay.mailchannels.net [23.83.212.6]) by sourceware.org (Postfix) with ESMTPS id E8501385801D for ; Fri, 2 Apr 2021 18:35:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E8501385801D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=nadler.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=drn@nadler.com X-Sender-Id: dreamhost|x-authsender|drn@nadler.com Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 90EE43618D0; Fri, 2 Apr 2021 18:35:52 +0000 (UTC) Received: from pdx1-sub0-mail-a54.g.dreamhost.com (100-96-133-36.trex.outbound.svc.cluster.local [100.96.133.36]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 20834361825; Fri, 2 Apr 2021 18:35:52 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|drn@nadler.com Received: from pdx1-sub0-mail-a54.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384) by 100.96.133.36 (trex/6.1.1); Fri, 02 Apr 2021 18:35:52 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|drn@nadler.com X-MailChannels-Auth-Id: dreamhost X-Unite-Blushing: 3577104a6ac25f9b_1617388552373_4053873791 X-MC-Loop-Signature: 1617388552373:2399269047 X-MC-Ingress-Time: 1617388552373 Received: from pdx1-sub0-mail-a54.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a54.g.dreamhost.com (Postfix) with ESMTP id D81E87E467; Fri, 2 Apr 2021 18:35:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=nadler.com; h=subject:to :references:from:message-id:date:mime-version:in-reply-to :content-type; s=nadler.com; bh=lH0LKWAVOx4Gw81nENb6eydti7c=; b= xzDEjtEzqjSWxXggE0MJkpxQYJtKF1/3XnI1CluB92iPh/i/NmOKs/PhOP89SVf+ aldCIHxn3AFVb+LIw5vKHrqAhlpAZjgHiApIj29v5WcHUC9h1gBoeJvLvLj7QAyp WwOjBd4xMyA9wwm1qj3ZB/W10zdvwRs3Si6gJP/7nzk= Received: from [192.168.1.3] (pool-72-74-171-157.bstnma.fios.verizon.net [72.74.171.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: drn@nadler.com) by pdx1-sub0-mail-a54.g.dreamhost.com (Postfix) with ESMTPSA id 822AF7E457; Fri, 2 Apr 2021 18:35:51 +0000 (UTC) Subject: Re: Fw: Some questions on reentrancy, __DYNAMIC_REENT__ and _impure_ptr To: Craig Howland , newlib@sourceware.org References: <05ad18dabb56d23d26f1d9c493bcce0c@nicolachel.net> <15c0dc57-264d-18b8-5589-87e50288f39f@nadler.com> X-DH-BACKEND: pdx1-sub0-mail-a54 From: Dave Nadler Message-ID: <9d80da2e-002d-dc4e-7608-f70211291f47@nadler.com> Date: Fri, 2 Apr 2021 14:35:49 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Apr 2021 18:35:55 -0000 Sorry if I was not clear: If you use one memory location for _impure_ptr, and you have two processors running two threads, this does not work. Instead an alternate mechanism (ie thread-local storage for this ptr) is needed, to support each concurrent thread with a separate reentrancy structure. Hope I was clear this time! Thanks, Best Regards, Dve On 4/2/2021 12:51 PM, C Howland via Newlib wrote: >> ------------------------------ >> *From:* Newlib on behalf of Dave Nadler < >> drn@nadler.com> >> *Sent:* Friday, April 2, 2021 7:34 AM >> *To:* Nick >> *Cc:* newlib@sourceware.org >> *Subject:* Re: Some questions on reentrancy, __DYNAMIC_REENT__ and >> _impure_ptr >> >> >> Thanks Jeff also for answering the mutex question I missed. >> One other issue I should have mentioned that becomes more important daily: >> If there are multiple processors the simple _impure_ptr mechanism won't >> work... >> > Well, if you ignore the fact you have multiple processors and do nothing > about it, then, sure, you'll have problems. But if you manage it (e.g. > treating each processor as its own thread, or as independent of each other, > etc.), then multiple processors can work fine. (I have such systems > working.) > Craig -- Dave Nadler, USA East Coast voice (978) 263-0097, drn@nadler.com, Skype Dave.Nadler1