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 D1FDB3858038 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=5ffa2b25 a=kiZT5GMN3KAWqtYcXc+/4Q==:117 a=kiZT5GMN3KAWqtYcXc+/4Q==:17 a=IkcTkHD0fZMA:10 a=CCpqsmhAAAAA:8 a=mDV3o1hIAAAA:8 a=AIPdC31oAAAA:8 a=uYT-Tk0qkVT609LjNaIA:9 a=QEXdDO2ut3YA:10 a=PpX-2crAHtMA:10 a=fOcBNXRhbC4A:10 a=Kn6ebLBVpGwA:10 a=XYUH600dFVEA:10 a=ul9cdbp4aOFLsgKbc677:22 a=_FVE-zBwftR9WsbkzFJk:22 a=5478VIVnyzLWgM9zoUhq:22 To: cygwin AT cygwin DOT com References: <657c8576-2715-8c80-a59a-23453306230f AT netcologne DOT de> <32467133-a288-b974-4a86-fe17d1ac6a14 AT SystematicSw DOT ab DOT ca> From: Brian Inglis Organization: Systematic Software Subject: Re: PTHREAD_PROCESS_SHARED not implemented (was PTHREAD_MUTEX_SHARED on Cygwin) Message-ID: Date: Sat, 9 Jan 2021 15:16:04 -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: <32467133-a288-b974-4a86-fe17d1ac6a14@SystematicSw.ab.ca> Content-Language: en-CA X-CMAE-Envelope: MS4xfEhA1zuPWdcjq/1/29Q34xJYRQh13n8Q/UZtw4T+YjX3zHaqsyPV/+7fZvJ3OfGV38IyiEj1s0JM7KQJQxNFs9Kclq2QPDWL0wiwv10VixFjM+xKd2FV fXj/Mi77396FR2PGGOfxgwR936mGdu63tfLUASW/Zn/SNTGzoI5f1aO3fFJrdO7bM26pbUUwaPS0gkS1otKOgZuMxWren3cINus= X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, 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 109MGc6G031888 On 2021-01-09 12:58, Brian Inglis wrote: > 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. It looks like there was nothing on this between implementation circa 2002 and: https://sourceware.org/pipermail/cygwin/2019-February/240178.html Presumably your goal is to support or disqualify gfortran coarrays: https://gcc.gnu.org/pipermail/fortran/2021-January/055542.html For more about Windows limitations and alternatives see: https://www.boost.org/doc/libs/1_75_0/doc/html/interprocess/sharedmemorybetweenprocesses.html#interprocess.sharedmemorybetweenprocesses.sharedmemory.emulation and the internal page link target: https://www.boost.org/doc/libs/1_75_0/doc/html/interprocess/sharedmemorybetweenprocesses.html#interprocess.sharedmemorybetweenprocesses.sharedmemory.windows_shared_memory -- 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