X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 518E83857004 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1630163870; bh=u9PjRaV7JWzz+7D8Z01W3SPR4X3Tgl3GFWkdgSG6dEU=; 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=FiGaWVbOlnc54RpxBCf2y+3HBQZ9ptnYu7Ep3LDJ5iZ2/eWHg4/NoIQaC2m2HS6/X 7g1LVVPIRkHqToKmC5ugG1aDeNL6BvZoS/UMSZzA/qOO4Vt+Jlqoa8lsR53t6zIVXL /yLHcK2uJ3ldoD3Awy4pvvCBQn8dTDtYYrkY2pOg= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8820F3858417 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=C+MFrGVPULw6i/2cBmFd46RK6n5vqM1IqaaKtwoixoAn9Ncb0K9TXWtEasYG1rfigrW91sPlyJ2kpmhChV3z1uVJCKHfOtDhbBa0Ml25FdebXaZtMLUYu61e1wR83wxJ2rRUTbor7YsffeaXofjy7nplx7Gcr04ezQH/RXQ7Boop4woAzRhpL1b1ptQBczH6GicvtCp2hj1ph6K/Kke5Nhnw8poTg7UmiBtNVXcA9YNVSRzoi2vtekm1SWP5o7xmMGsl/76AmEB75Bu2kQjPFjOelX+L+mUpYqW4ZTtB1ZjsoZSO6xUl5kDjr+JKKgzN3+keWKFN7E67Kz2b0yB4Jg== 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=G84lGEXWLOvB9IKdiKc48/WbtdgJJ284H/BPhwTVuW8=; b=MOPRN+VjqqhHDhZ3uCVsoJvg8zGgaxoNF27n3LZyg1io8W+PnTstoGaa20A65p1ro2s/LPXHXfMnqiXmNeHdIEBnMOmFEtH3Uj2EYquZgr/Lycw2nV8bTjiMEtOT1NvLA/icWVrLqMTODpleacBmhQF9TTKZkLS+x0E025xyUM051wKDS8NfKgoi5RTeg9s5WMSNbM7JrT1tH4m/5aJDjvdrUThFnActi7ittFGzn6h1odc25PuVpfkFybWVFqzAV24oEMBq3PJQGTK63W3fSwRu3KpYibalTIOScB96Shuk5OYOLx6QePwp9cpRz3ziJ0jhv5maSWq+nBgHQczMDg== 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: cygrunsrv + sshd + rsync = 20 times too slow -- throttled? To: cygwin AT cygwin DOT com References: <41A583E1-C8E7-42AB-9F24-EEC33A41EC60 AT house DOT org> <20210825201845 DOT 07b6400b79dc5558a7761efe AT nifty DOT ne DOT jp> <20210826062934 DOT 54f2f2216021c095bb7ba13b AT nifty DOT ne DOT jp> <3b560051-ab27-f392-ca4b-d1fd9b5733b0 AT cornell DOT edu> <20210827202440 DOT 47706fc2fc07c5e9a1bc0047 AT nifty DOT ne DOT jp> <4f2cb5f3-ce9c-c617-f65f-841a5eca096e AT cornell DOT edu> <20210828022111 DOT 91ef5b4ff24f6da9fadb489e AT nifty DOT ne DOT jp> Message-ID: Date: Sat, 28 Aug 2021 11:17:07 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 In-Reply-To: Content-Language: en-US X-ClientProxiedBy: CH2PR18CA0014.namprd18.prod.outlook.com (2603:10b6:610:4f::24) To BN7PR04MB4388.namprd04.prod.outlook.com (2603:10b6:406:f8::19) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.211] (74.69.128.111) by CH2PR18CA0014.namprd18.prod.outlook.com (2603:10b6:610:4f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4457.20 via Frontend Transport; Sat, 28 Aug 2021 15:17:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3302891c-dbb7-40d2-7501-08d96a36e6da X-MS-TrafficTypeDiagnostic: BN7PR04MB4257: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WAbYmCZe8/62OguqmzGhjwJd1DhhAJcHUk+xU3Bxke3jQLXVbr/J4U3TXodx0cLUgUBWJxgsPn821o/UldY87/Rd4KREJBGpIMjatNm6kvZabJMfvucWQ1ky2cc+64U5I2MC3lWeIDz3/QdFdHvzRcFFrIsYJBrftq/Viitk3A075F/ytqXkZqyaoN24wbX1jRVEaY8oVhRmB9Kc1LXtGZgk4sl6XGi1Wv8PeBeofYTF8eH5HQVlNDz3WPPB98cNaOjn4G8XuO9xPQd63kMyhqWOft1CkGqrfwDxPPU8UCdSlICzJB5ET/X5GOvVSnPCQbyB/SXfslE71iDkzDTK7t/0tvsSx1LbD3UIm+AgEB+HnVooEKI6kDkiX64twSkaiw9n6tMFDGVvmi10EWoAKHtf5mHdt2PATRyBAzTkNWMB1sAAs+nJL9oYDBCCFWdg7SL+gRc37CZYZzazNdFPYGcfzMruUcRfhW/5DdkINLC5Ja3FKAqIZHZ4c8hjTD8GoRSNcgpgRH1hCnH70ypcg7nnle7jbCNNfMnrBJwalb/zGYa/bdbM/qzM+DjBIjh+W0J6oNFE7G+zeEEmTqZTXd4MyqAK3kdARIgmZGRQoQYwTRSeU0hSx80gJH/68jtJ2CSvrjMJO7aRfKhA0mwNvHkHu8I4rD/eHNhduwHthvO8VHQlFdh4nBrpxTVebd6agslODAkzevOJf1jHPIfYC9wqpmccNeDChc8PDvY32Qg= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN7PR04MB4388.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(136003)(39860400002)(366004)(396003)(376002)(478600001)(83380400001)(31686004)(36756003)(75432002)(8676002)(8936002)(316002)(186003)(6916009)(2616005)(38100700002)(5660300002)(16576012)(66476007)(786003)(26005)(66946007)(956004)(6486002)(53546011)(2906002)(31696002)(86362001)(66556008)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?Windows-1252?Q?/UX3t3tOFWutjjZEPaId6b90p9NNbkW0qY7bVuvfxhMF/3h9TKUzeGON?= =?Windows-1252?Q?dLeeXDtztnNvFWmvqbby7dy7l6NpbzzRy2i/06EtZscgDQ/xa1HleAgL?= =?Windows-1252?Q?E7QF3UDM53CNLIQCYoOGX6lYmqJk4oqonwqusH+FQBFJi7d7Vvtm3C77?= =?Windows-1252?Q?/+midtV36Id6mJETG4ywRW7V8jPUz50RL5lsrkY7LxaajmD26d7P85y9?= =?Windows-1252?Q?d19miYu2JrVdl8nKz+4ouHoxM4c3Nr0omE0piBvI5Y3iY72XxNRqym8p?= =?Windows-1252?Q?Tr9ANWfSyV/OV4hvroRbtDacPpy+AQZWXdaSzJ7cS+KvesL1RQw3MNKP?= =?Windows-1252?Q?xnuQHnLqSxKWTH+cER62Y7OBDRUh/tj2TgU43zbNJxU5jvuHyBTOFtzK?= =?Windows-1252?Q?/5qJTsoGAzsBPoWfT3ZXT9V3DQf0I+whX5PoSJ29U0IWYmRlOvAkaTLV?= =?Windows-1252?Q?wEDEvkn/knbkHUIoXwGDV9O4+Qec4fhU+JennaypIE8+3Z4hD0v0GEkB?= =?Windows-1252?Q?79DBUm9BK/NJWlOJnGv8F0PYu441WTNI5D2SYeBySjR/E1kNvgDo5kRr?= =?Windows-1252?Q?Neyniy+ftEqxlGxAoLNAAmTi9TXjBU+WBQLc3931uYGvdoT9kD2jzmhy?= =?Windows-1252?Q?UGQ+Bq5PzppxRFtkbB295re6BwiKYsQeOFf8/XlYMYlT0TeJOxh9uwbO?= =?Windows-1252?Q?+s8vW22+Vs5JVg3T3ruogu5GZk5eEWzjzw6kw+eN21E8AwGZt3Tamgse?= =?Windows-1252?Q?KZbXWC8zNMhDacT+DuPPb2bZH6aB2nSSRdSQHKaxt4jXvRgHE1yhJEHw?= =?Windows-1252?Q?7gZX4F0T8m7W/TI2uJIBStd+32HYfp0oF+bAqVhi6yqECPdSG5t5Teu7?= =?Windows-1252?Q?DPj7XzLmHoNpWwWILkMZZYNORLGt3UX9LSLfUC/kJxtSE6IIvUNYUsnr?= =?Windows-1252?Q?y9AMpurtXEFu+Rgsw2KwU267gEBZmoI1HEkqiwNsr9FW+Fcxb5ZwqpN5?= =?Windows-1252?Q?r5K+LtR74rk5EiQhpU3f9x5Z77+WUK+FmZVN56PythGlagBDWyHzeqTI?= =?Windows-1252?Q?61VoM7N4L0kmN0SDVHuVEYmcm58T3M9XRP2XVo6J5fObZT9H8wkbXN4L?= =?Windows-1252?Q?KWjsxA+m6zcDt2vUl0JmuCHPSAg5yW0elplPTtr+JxVJBIEV8hyfjEcJ?= =?Windows-1252?Q?DN6vjb37kUL4rUn5DTZ7qMLU8jKpuAlv7qx9ravgr8yWsFlvo/CuOhyF?= =?Windows-1252?Q?r7ja3TJ/qrlDcRH9HgkMMu3CWPe6WjKpqaXZ6aW+gh2QBMvBY8PD9QGS?= =?Windows-1252?Q?fzDZnu+dTxACJQpbvm6n4CNpv5PihRPqV9QDlNfrfjnyEyIxWURdmQDo?= =?Windows-1252?Q?eXjVttPAaaUYiALJ7OJvqbm5daQ61GyZdP7QMzWPz2MUa8L2TOYKM/oy?= X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 3302891c-dbb7-40d2-7501-08d96a36e6da X-MS-Exchange-CrossTenant-AuthSource: BN7PR04MB4388.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Aug 2021 15:17:08.4849 (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: zFvYD6x7hBnpH4gVkmedrG7eAFTxSRBUKLqcmpM5stxFRHXkihixsbrc38gxH3GpBsPXZrXDweklGP+qMFDhcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR04MB4257 X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, MSGID_FROM_MTA_HEADER, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" On 8/28/2021 4:43 AM, Corinna Vinschen via Cygwin wrote: > On Aug 28 02:21, Takashi Yano via Cygwin wrote: >> On Fri, 27 Aug 2021 12:00:50 -0400 >> Ken Brown wrote: >>> Two years ago I thought I needed nt_create to avoid problems when calling >>> set_pipe_non_blocking. Are you saying that's not an issue? Is >>> set_pipe_non_blocking unnecessary? Is that the point of your modification to >>> raw_read? >> >> Yes. Instead of making windows read function itself non-blocking, >> it is possible to check if the pipe can be read before read using >> PeekNamedPipe(). If the pipe cannot be read right now, EAGAIN is >> returned. > > The problem is this: > > if (PeekNamedPipe()) > ReadFile(blocking); > > is not atomic. I. e., if PeekNamedPipe succeeds, nothing keeps another > thread from draining the pipe between the PeekNamedPipe and the ReadFile > call. And as soon as ReadFile runs, it hangs indefinitely and we can't > stop it via a signal. > > Is a blocking ReadFile actually faster than a non-blocking read? Or > does it mainly depend on BYTE vs. MESSAGE mode? > > What if the pipe is created non-blocking and stays non-blocking all the > time and uses BYTE mode all the time? Just as sockets, it would always > only emulate blocking mode. Wouldn't that drop code size a lot and fix > most problems? It would certainly reduce the code size. I think it's worth a try, and we can see if any problems remain. 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