From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Newsgroups: gmane.emacs.bugs Subject: bug#75275: 30.0.92; `make-thread` bug on macOS 15.2 Date: Thu, 02 Jan 2025 14:05:44 +0100 Message-ID: References: <86bjwplmc1.fsf@gnu.org> <865xmxlivo.fsf@gnu.org> <86y0ztk323.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16191"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 75275@debbugs.gnu.org, Eli Zaretskii , stefankangas@gmail.com To: Alan Third Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 02 14:06:23 2025 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tTKu6-00041I-LF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Jan 2025 14:06:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tTKtn-0001yG-Te; Thu, 02 Jan 2025 08:06:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tTKtm-0001xL-Gs for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 08:06:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tTKtm-0002X5-8j for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 08:06:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=jrVq33zu4kRTuao5Z9YtFrbO4o7AbSAStuN39v5D5f4=; b=Dhtq9i7fA0X5o2/Qd5VNnlzsrGKnlnPbnSF5HyTKau/VvszUo3+j3YE3bnKFxxgebJR2oAwU+Jmm4Us0IwEohWUuxULmHNSCH2yP0uPqO77CCBMd8MVmjGkh5SGNdY4llz89ymXgWReus5O0y/sXlCbfijqLN2TceZEIvIKZYkkP2a7Sk4uMsiQjVqvYTViIKo32ZO3qt8dpD0LNPhEDYoKjOxgpJ6SMLDVNJ8B47++tbLWflwGcad1DjQPmz0u3JjvGSxTATCLOhtv/Bcm/p/8tD7KWhHIH0NMYf2dIpHkPZA1MhpWU3GBKSj9Yl7VokPUfOJzflqNzygzUvmYthQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tTKtm-0007Tg-3S for bug-gnu-emacs@gnu.org; Thu, 02 Jan 2025 08:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Jan 2025 13:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 75275 X-GNU-PR-Package: emacs Original-Received: via spool by 75275-submit@debbugs.gnu.org id=B75275.173582315528729 (code B ref 75275); Thu, 02 Jan 2025 13:06:02 +0000 Original-Received: (at 75275) by debbugs.gnu.org; 2 Jan 2025 13:05:55 +0000 Original-Received: from localhost ([127.0.0.1]:43082 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tTKtf-0007TI-6d for submit@debbugs.gnu.org; Thu, 02 Jan 2025 08:05:55 -0500 Original-Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:51303) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tTKtc-0007T3-TZ for 75275@debbugs.gnu.org; Thu, 02 Jan 2025 08:05:53 -0500 Original-Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-43621d27adeso78467935e9.2 for <75275@debbugs.gnu.org>; Thu, 02 Jan 2025 05:05:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735823146; x=1736427946; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=jrVq33zu4kRTuao5Z9YtFrbO4o7AbSAStuN39v5D5f4=; b=Z2YhvoJ3Xj++dpWvmOJ5N3ftwEMKY6ZWvq0khKZ1AEWKDupUSyTEqjmITJpq4u4z09 mN/yrwCvVCmgjmiFtGsVBiqtrzK+VjVOV8pXaSIqTcodsGLSBsY4kgEGyq604Ss/+Yrf wVYqPN6w40H20Ee5JF3f+RCuY0ceDxGonJh4ov1qOPid7jvmRpfaxT+8PVvpXnj5M9EI H9dvMBfUdq+v5NOXczhDdkGr6cfX5vtnlx9PEjJOgULHkyfqJk7ppE6S0Yj/IXokkhCg io6NTvxD5TVOXyVfQTnsNkvpER3oZ4aa6PtHT+PEKkyYD0o+h/9tCSBG7rFZPcD5MR5r /u6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735823146; x=1736427946; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jrVq33zu4kRTuao5Z9YtFrbO4o7AbSAStuN39v5D5f4=; b=Gp+jGBwNiykjGv1XmOXHOgelBm2rAllJZ7iNdIzYwNS5iG70xh0PaIxiz7FvqQqz16 VM9BHOd8AAXlTKCWeiQ3isdcgnZYRzns5iMk+m1UwI2mcU0LlNq8mvcVZmdxtTWcMm8b b1rX7GlGGwSBK0BGMXhsxCcY0JyDNFgBNGg6vCF5116VCNkWWomp1sJMWPOF6mQPH0Fd WKU5XjIwA7onqRs1bpcKSHo0qbbWAs6aB0YJK7q+WgdHnTo0RAN89yVVboCYLzMVNTCP NCYkDfs+uFEgACW3s0k3WpW+7AwDEGJrixvCLQnuROHnv56qkPW2gF7n/y/Yj2jt6C6f +H7Q== X-Forwarded-Encrypted: i=1; AJvYcCXbEWz+XYG5cvr3uWjLcDATcJLLb1PhWyJ0CJrtBNcaBIMKWRiSVlaoB0mwgmrjcty5KHI5cQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YydwuoBihysm/1JHbo36aSsvHuc9pFagHhemUdmD4t4GVgCIHPC 3dtJ9VUKX5Q1eNSLOoYBlA/sPQm3jZxmFsAKJAAy93Plo94IWqq9Fhy7Ag== X-Gm-Gg: ASbGncv4nbTNaZzz/W1erAksZE4+mXZCtnMHFiZtGbTNGM2A3HViNHe7b4gzK7hJ14i vjUaCrz7z8QfeRaWWjTAIUwwcSESmspq8GgS8kapOeF25nUTzXPihFLXQxq8MiWTdH0upLV7Pnv 5jYUovnjZCW5gpSREzpO93ru21+C5HcGyds3ram3J4kaumR8/vr0toxsjVX/oHyyWUBcIj2zwnu UZ306R5SxshJXkuSJhVtjacJoxGh5ovgll5zfDZBSOJNlVQCLEFa+TlSD7psKmHFZ+lW5hMq4zW z85/ZfjASGszftQiiV2gMktcsqG5VYh7hUHBUtrxVJQNm25O/Z7Ux6cY5918iF6J X-Google-Smtp-Source: AGHT+IE7ULK2M/Cvf1Df415SIJuM/3fUibKy1hdSaHwODE7z2jw6VMxnY4fBNvxc4pPV46vDFEaK4g== X-Received: by 2002:a05:600c:1c91:b0:434:f219:6b28 with SMTP id 5b1f17b1804b1-43668b499f6mr344534935e9.24.1735823146029; Thu, 02 Jan 2025 05:05:46 -0800 (PST) Original-Received: from pro2 (p200300e0b7290d009d701914d6a76d9d.dip0.t-ipconnect.de. [2003:e0:b729:d00:9d70:1914:d6a7:6d9d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43656af6cbbsm485548855e9.3.2025.01.02.05.05.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 05:05:45 -0800 (PST) In-Reply-To: (Alan Third's message of "Thu, 2 Jan 2025 11:03:50 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:298162 Archived-At: Alan Third writes: > No, none of that needs to run when we're not in the main thread. > fd_handler run pselect in a separate thread because the NS main thread > has to run the ns main thread run loop to handle incoming IO from the > window system. > > The NS run loop can emulate parts of pselect, but not the whole thing, > so we are required to run both the NS runloop and pselect > simultaneously, hence fd_handler. If we don't need to run the runloop, > i.e. we're in a non-main thread, then we can just run pselect directly > and ignore fd_handler. So IIUC, you'd write this in ns_select_1 if (![NSThread isMainThread] || (timeout && timeout->tv_sec == 0 && timeout->tv_nsec == 0)) thread_select (pselect, nfds, readfds, writefds, exceptfds, timeout, sigmask); as return "return thread_select(...)"? One strange thing about threads having their own event queue is that the message Stefan sees comes from the NSApplicaiton::run in ns_select_1. Be that at it may. (BTW, I've given up on NS completely, meanwhile. Always building --without-ns.)