X-Recipient: archive-cygwin AT delorie DOT com X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5E3BF3861012 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=SystematicSw.ab.ca Authentication-Results: sourceware.org; spf=none smtp.mailfrom=brian DOT inglis AT systematicsw DOT ab DOT ca X-Authority-Analysis: v=2.4 cv=NYRYa0P4 c=1 sm=1 tr=0 ts=5ffa0ad4 a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17 a=IkcTkHD0fZMA:10 a=CCpqsmhAAAAA:8 a=94nOnFI1EgyDtX4ev68A:9 a=QEXdDO2ut3YA:10 a=ul9cdbp4aOFLsgKbc677:22 To: cygwin AT cygwin DOT com References: <657c8576-2715-8c80-a59a-23453306230f AT netcologne DOT de> From: Brian Inglis Organization: Systematic Software Subject: Re: PTHREAD_MUTEX_SHARED on Cygwin Message-ID: <32467133-a288-b974-4a86-fe17d1ac6a14@SystematicSw.ab.ca> Date: Sat, 9 Jan 2021 12:58:11 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <657c8576-2715-8c80-a59a-23453306230f@netcologne.de> Content-Language: en-CA X-CMAE-Envelope: MS4xfFgy9e8kDjZfcKbnHp8w3Xt0RHPGNUjVld6109qWwgH5mS/soPgnK5q+o9Jh2xUazk9VKJy29n62cfd53Xm/NZoj0Nqbv+5TGBUSfg/XbalkdEbXpv1X Mby4WHauXx5EhkSkKo+ebud2OZldTbFJk5MW2YgXYcm/4InxyDEWFrVjDKSsRbNDMomcGrSwvMTJ8L9rIhMeAKvtEmIc27oWT98= X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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 X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 109JwfEq013914 On 2021-01-09 11:23, Thomas Koenig via Cygwin wrote: > there is a branch of gfortran for implementing coarrays based on a > shared memory implementation instead of MPI, the devel_coarray/native > branch. > > I tried it out on Cygwin, but it doesn't work there (hangs on the > first sync). > > The branch uses pthread mutexes and condition variables > with PTHREAD_PROCESS_SHARED for synchronization between processes. > > I also ran the attached test program, which gave the output > > pthread_mutexattr_setpshared(&mattr, PTHREAD_PROCESS_SHARED)failed: No error > > > Is it correct that PTHREAD_PROCESS_SHARED is not supported on > Cygwin?  Is it supported for condition variables, or is the fact > that it is reported as working an oversight? The function is supported but that parameter is not implemented or tested and returns EINVAL: https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/thread.cc;hb=HEAD#l16 https://sourceware.org/git?p=newlib-cygwin.git;a=blob;f=winsup/cygwin/thread.cc;hb=HEAD#l1889 > If PTHREAD_PROCESS_SHARED does not work, are there known workarounds? If you have the ability and time to work on this, one of the Cygwin developers/maintainers may be able to assist. -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. [Data in binary units and prefixes, physical quantities in SI.] -- 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