From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by sourceware.org (Postfix) with ESMTPS id 3914A3893C69 for ; Wed, 9 Jun 2021 12:27:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3914A3893C69 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f52.google.com with SMTP id 3-20020a05600c0243b029019f2f9b2b8aso4085551wmj.2 for ; Wed, 09 Jun 2021 05:27:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=w9LTXQlglj7lHxs1CCMBKCpixxsAB4yHGJmih25IRXk=; b=LdDrN4aGCfFaOcTwNUF66lDxTmwWqEhGjBhXfUnHFGzeZamMrZRWWR04J/+CVVX3U7 tJSNj6Kr9iMzt4q/QGaZD026j6iq3sRgbPxVM7LX89HOgcJWIKHvHeK8We3+7R4YUE+m oBkWGjG4c0dcITJF0nOW6QKbQxIWawG9q1rsOxkoXmf9aaJRWxW0BGwymmCiIKApHkzE ZdkUnUrDmr9tR9h4VbOx0oWZX0WLz9xdTdyo4GjZeLVypY4dTfKNGlKxpqf7k+bmpuAl Jv8lJfgmoiVa9eo9FBockXPAcEmO8Pe0CBQx31TJn1YUZy4TuMgeTPoHIt9ly01aDKaz VEhg== X-Gm-Message-State: AOAM531okHB6qzDhi9dmT4d1eKgTl+527KU5v5Ojif1tAZDv+gA4b2F7 SPqL3bXVzRRlZ18nWWkp8RrVjeNETk/Qhw== X-Google-Smtp-Source: ABdhPJy+GpFEyQVqUTZSEE09Mk1lknUxVWX/8Y0OBOL19GhTQhay4i9Q/cSjwg7QoAg0Lzl22J3zsQ== X-Received: by 2002:a1c:a484:: with SMTP id n126mr9612007wme.34.1623241647425; Wed, 09 Jun 2021 05:27:27 -0700 (PDT) Received: from ?IPv6:2001:8a0:f932:6a00:46bc:d03b:7b3a:2227? ([2001:8a0:f932:6a00:46bc:d03b:7b3a:2227]) by smtp.gmail.com with ESMTPSA id j34sm5784872wms.19.2021.06.09.05.27.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Jun 2021 05:27:26 -0700 (PDT) Subject: Re: [PATCH 4/4] gnulib: import select From: Pedro Alves To: Tom Tromey , Mike Frysinger via Gdb-patches References: <20210529172510.16285-1-vapier@gentoo.org> <20210529172510.16285-4-vapier@gentoo.org> <87bl8hn3y5.fsf@tromey.com> Message-ID: <46d0d024-1892-3584-3523-e8f5b2997630@palves.net> Date: Wed, 9 Jun 2021 13:27:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Jun 2021 12:27:32 -0000 On 2021-06-08 5:52 a.m., Mike Frysinger via Gdb-patches wrote: > On 07 Jun 2021 08:29, Tom Tromey wrote: >>>>>>> "Mike" == Mike Frysinger via Gdb-patches writes: >> >> Mike> A few sims use this to emulate the syscall & provide network >> Mike> functionality. >> >> Thank you, I think this is ok. >> >> There are some gnulib modules that don't work well for gdb. >> The only one I can really remember is 'stat'. Hopefully select isn't >> one of them :) > > that would be unfortunate, but i guess we'll find out. i'm not sure how we > can balance these tensions short of each project starting to carve out their > own gnulib ports. I think that on Windows, gnulib's select module does something very similar to what we do with ser-mingw.c's gdb_select: ~~~ /* On Windows, gdb_select is implemented using WaitForMulpleObjects. A "select thread" is created for each file descriptor. These threads looks for activity on the corresponding descriptor, using whatever techniques are appropriate for the descriptor type. When that activity occurs, the thread signals an appropriate event, which wakes up WaitForMultipleObjects. ~~~ I've always feared that gnulib's select module would conflict with that, but I don't know for sure. In theory, we should be able to replace all that code by using gnulib's select instead, though I'm not sure gnulib handles some particulars like Ctrl-C interruption. I think we can avoid some pain of someone tests the import on Windows before merging to master. Thanks, Pedro Alves