X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 63957396EC92 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1590012218; bh=KwSXdLbTz6sWMG2/SFhsS7o7dNHRynXZUGtJuRhFj4U=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=NScIPFKW8CJ4l/9tXVYkgjAiFuPjGcFdO1VwPRPCAjtyQh/vcgSqongHCmqxZ3Xby Lx69F1LiL8Oct2LBT3carRI8CUAbSr+E3AlES0+rB6L6V/eoCo++Ggc6s/GdSPy71/ oYPZXla0zpskhsWy3ZOxjR/96zoSKRxlzTbPhRZ4= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 660ED396EC7F ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f/Wopxk2nlfLnoZI9x4X52c1Jny8bfx8RlXM1vOLR/5D3ZlGmdZ0l4FpHM2qAyA+4bIEo/S/piP4A920iFk6gqT/IROqDdaavy1atE6i/egZsw3O/nwGvWuJRa6t9HCGDJufPVoFu3EED0zzzhEGk7mUws5B/mihYvVKaxgB83TE+hPVK2tQnnQMfWgKR1YSwm6A9wyhXDiJrsJlZZSgKax7RHeUiX3yseNbMsUrjv26DBAqg37v8T5dFEzDN+OmBRmev9tW5jm0XSEl8leQbKpvwaXv/FmPtdVbtT1hbdkm+Oa8KNT5DgkAG5bDxOlxKN57+IoClvwcc3qAbmekMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Dzg0oydjjP9RF9MntrCCTB4YoHzm+eSsCLwWl3zOACY=; b=JaDAthEvbALruVYjdyeOoTonPo0/S6Im86vgjND6AY4lWKIE5PGLVAO5RSgC7edxhtBJuhJdKOKkL/KuskyFFe+k7U4J2Feq6n6LcNxPPleGVvsJlFKY5zXd5TRkGZURohwvfgPJoX7ag0x6d6y3ggwlpdWd7N/aXr3mLRvOBHLhkoConZhCi/moY8JrM6Rquj5+cCckCrd6+NL+ue2T+4IptYfQygFEC7DP91C9qjQA2974TzpPcNJ7xCPrG6DSiX0ovT/7kDjUYSuEJlF6jQg9GdBwnlRuLlRYBBRDBVyGW6OXK3RFQhWIw8eQ6WwFALx8h6dnZIVXEMT9voYjQg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none Subject: Re: name pipe problem: 1 writer, multiple concurrent readers To: =?UTF-8?Q?Morten_Kj=c3=a6rulff?= , cygwin References: Message-ID: Date: Wed, 20 May 2020 18:03:27 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 In-Reply-To: Content-Language: en-US X-ClientProxiedBy: MN2PR19CA0021.namprd19.prod.outlook.com (2603:10b6:208:178::34) To DM6PR04MB6075.namprd04.prod.outlook.com (2603:10b6:5:127::31) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.17] (68.175.129.7) by MN2PR19CA0021.namprd19.prod.outlook.com (2603:10b6:208:178::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.23 via Frontend Transport; Wed, 20 May 2020 22:03:30 +0000 X-Originating-IP: [68.175.129.7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e03036de-6666-4883-f2b6-08d7fd09a1ad X-MS-TrafficTypeDiagnostic: DM6PR04MB5722: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-Forefront-PRVS: 04097B7F7F X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: L4j2yLNftwpKfTRvjMfadmZIy89aZI8rj03m3MUUpWGhyQRcEo1rCU67kIwY0vB41lhilb2wWbJY1MaRloKnht59jV8xBYnQVm20ONpjxcY1STB3CgQwHt20x4hxesRmG9BGJYbgdf9CBUMT+vIyWO7ydoz47+XYJi7fjZB6FRIk4eKMqTrJEQXu3j6dk5z9Mhpq+LRH7ThmpJ0BX/6eW/50utYSCffh1mEnK+qmBjwEEAZmwka1EBVv+hosR2xjJL4+Dg0Mk+IiHmOq25z+UIjIzytGeoqnqlUdAwKtQj8mK9m6TJNZfb30mPScMt4cqJCmOxa5Te5ypbvawwKpVX9OzV+9Kj+SW/BF3H/irzP4aD07ArTNywsUZg2n++ybahGkBfase1su2+mWWkXm++yCnrRkyaV/jBExa3zbFl0GsKkeHTREljmkO8VKtNFGWrrbxwc4HHHfDCIcPLspUXnkN118BzwISAvU8pbGgI1hifw5OzO/70u5kUmDppIlJXYJflt4JG4TdjBltZ2zHFvy97FhqST0+FNCV3oDAUqIOKANaakqhwkrMHmcWoRD X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR04MB6075.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(376002)(346002)(136003)(366004)(396003)(8676002)(8936002)(36756003)(53546011)(52116002)(2906002)(31686004)(6666004)(316002)(86362001)(31696002)(16526019)(786003)(110136005)(186003)(16576012)(75432002)(966005)(26005)(2616005)(66476007)(956004)(478600001)(5660300002)(66556008)(6486002)(66946007)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: c6dXyJ+qToTybk9ERHzGsAx/7oTZwlwQUCZeX7cDwNUCO0I4AweouVtzxUmClYXQvdMF3s7IU6QanKQwqggrcNwgWc9lWS3YSjjdtTtUMYNRcQAMuIfyh577k4DBAAeyi4QW0l5LjMaGN64FnVeoZNuLYWZKcP/MZRkI4dcEHA/X5O0BcOyDkyaSungzxVmJmNN8UOLOX0lkvNwplIVFbb8D/T4ZjSaOdDfdpG2k31d5pvBlOy/XQ/Bj19adGJGw/ws+1AqrKzXUQX9h8isav6X2ulOkgXI0EGzviUs7EuFcqjrDZqjJY9+MXTPsVeY5hVvmVa5D97tc7qKg1T+Gm+h9gZWZZ69Y1NILEgtLh/2HLhlrWG+lEnwMgQxm7ztC9HgT8rwyyFhozFBPJjQRESSTtyeOMDxFzyzipiCiNoPXp9CCejwR0ZFUxDR06kl5TvCpesvc7vu2zbmKKBK4gMpCXjhq2RhmZ0lygvacOvk= X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: e03036de-6666-4883-f2b6-08d7fd09a1ad X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 May 2020 22:03:30.7357 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: W3aetWkoU2r5ZTYyA35jzrKsPavjLqjLbT8H1UDGry+5iqB1KC6NGTZX2SrkDsFzhGHMxFpEddix3ETWeQ8dww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB5722 X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00, DKIM_INVALID, DKIM_SIGNED, KAM_DMARC_STATUS, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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: , From: Ken Brown via Cygwin Reply-To: Ken Brown Content-Type: text/plain; charset="windows-1252"; Format="flowed" Errors-To: cygwin-bounces AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id 04KM475m032335 On 5/19/2020 11:20 AM, Morten Kjærulff wrote: > On Tue, May 19, 2020 at 3:55 PM Ken Brown via Cygwin wrote: >> >> On 5/19/2020 7:26 AM, Morten Kjærulff via Cygwin wrote: >>> Hi, >>> >>> The following script: >>> >>> #!/bin/sh >>> >>> rm -f t.pip t.txt >>> >>> mkfifo t.pip >>> printf "line1\nline2\n" >t.txt >>> >>> ps >>> >>> { >>> while true ; do >>> cp t.txt t.pip >>> done >>> } & >>> >>> rm -f t.rc.* >>> for rc in 0 1 2 3 4 5 6 7 8 9 ; do >>> { >>> diff t.pip t.txt >>> echo $? >t.rc.$rc >>> } >>> done >>> echo result1 start >>> ls t.rc.* | wc -l >>> cat t.rc.* >>> echo result1 end >>> >>> rm -f t.rc.* >>> for rc in 0 1 2 3 4 5 6 7 8 9 ; do >>> { >>> diff t.pip t.txt >>> echo $? >t.rc.$rc >>> } & # run the readers in parallel >>> done >>> sleep 10 >>> echo result2 start >>> ls t.rc.* | wc -l >>> cat t.rc.* >>> echo result2 end >>> >>> ps >>> >>> Give me output like this: >>> >>> $ ./tpip.sh >>> PID PPID PGID WINPID TTY UID STIME COMMAND >>> 1642 1600 1642 65264 cons1 1058872 13:18:58 /usr/bin/sh >>> 1600 1 1600 72728 cons1 1058872 13:18:33 /usr/bin/bash >>> 1645 1642 1642 42088 cons1 1058872 13:18:58 /usr/bin/ps >>> result1 start >>> 10 >>> 0 >>> 0 >>> 0 >>> 0 >>> 0 >>> 0 >>> 0 >>> 0 >>> 0 >>> 0 >>> result1 end >>> 0a1,2 >>>> line1 >>>> line2 >>> diff: t.pip >>> result2 start >>> 1 >>> 2 >>> result2 end >>> PID PPID PGID WINPID TTY UID STIME COMMAND >>> 1690 1688 1642 104032 cons1 1058872 13:19:01 /usr/bin/diff >>> 1681 1642 1642 95012 cons1 1058872 13:19:00 /usr/bin/sh >>> 1642 1600 1642 65264 cons1 1058872 13:18:58 /usr/bin/sh >>> 1684 1681 1642 99624 cons1 1058872 13:19:00 /usr/bin/diff >>> 1678 1676 1642 94532 cons1 1058872 13:19:00 /usr/bin/diff >>> 1688 1642 1642 88864 cons1 1058872 13:19:01 /usr/bin/sh >>> 1698 1642 1642 104820 cons1 1058872 13:19:11 /usr/bin/ps >>> 1692 1642 1642 66572 cons1 1058872 13:19:01 /usr/bin/sh >>> 1677 1674 1642 86692 cons1 1058872 13:19:00 /usr/bin/diff >>> 1646 1642 1642 30888 cons1 1058872 13:18:58 /usr/bin/sh >>> 1600 1 1600 72728 cons1 1058872 13:18:33 /usr/bin/bash >>> 1686 1685 1642 14320 cons1 1058872 13:19:01 /usr/bin/diff >>> 1685 1642 1642 25608 cons1 1058872 13:19:00 /usr/bin/sh >>> 1676 1642 1642 104212 cons1 1058872 13:19:00 /usr/bin/sh >>> 1689 1642 1642 98004 cons1 1058872 13:19:01 /usr/bin/sh >>> 1674 1642 1642 44152 cons1 1058872 13:19:00 /usr/bin/sh >>> 1680 1646 1642 28224 cons1 1058872 13:19:00 /usr/bin/cp >>> 1682 1679 1642 43612 cons1 1058872 13:19:00 /usr/bin/diff >>> 1694 1692 1642 67736 cons1 1058872 13:19:01 /usr/bin/diff >>> 1683 1642 1642 93544 cons1 1058872 13:19:00 /usr/bin/sh >>> 1679 1642 1642 90188 cons1 1058872 13:19:00 /usr/bin/sh >>> 1691 1689 1642 68560 cons1 1058872 13:19:01 /usr/bin/diff >>> 1687 1683 1642 83952 cons1 1058872 13:19:01 /usr/bin/diff >>> >>> $ >>> >>> That is, when I run the readers in sequence, no problem, but when I >>> run the in parallel, they either hang or t.pip seems empty. >> >> The current cygwin release doesn't support multiple concurrent readers of a >> FIFO. I have recently added that support, which should appear in the next >> release, although there are still bugs to be fixed. See >> >> https://cygwin.com/pipermail/cygwin-patches/2020q2/010195.html >> >> Ken > Great! Let's keep the discussion on the mailing list > Then we will have a read-only file (pipe), which is the output of an > abitrary command, right? Yes. > Can we have multiple concurrent writers and one reader, which would > become a write-only file, which becomes the input of an abitrary > command? That already exists, although I found and fixed some bugs when I was developing the multiple reader support. > Anywhere I can see the plans for next release, if any? That's up to Corinna. Ken -- 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