From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Introducing thread-safe Tramp Date: Sun, 29 Jul 2018 01:20:34 +0300 Message-ID: References: <8736wa9c5s.fsf@gmx.de> <3e63b230-6cc1-f517-da71-57b892e14e30@yandex.ru> <87wotfhdn2.fsf@gmx.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1532816324 15464 195.159.176.226 (28 Jul 2018 22:18:44 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 28 Jul 2018 22:18:44 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 Cc: emacs-devel@gnu.org To: Michael Albinus Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 29 00:18:40 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fjXXs-0003ug-Ap for ged-emacs-devel@m.gmane.org; Sun, 29 Jul 2018 00:18:40 +0200 Original-Received: from localhost ([::1]:46556 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjXZy-0000eh-Pe for ged-emacs-devel@m.gmane.org; Sat, 28 Jul 2018 18:20:50 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50986) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fjXZs-0000ec-2M for emacs-devel@gnu.org; Sat, 28 Jul 2018 18:20:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fjXZo-0004KF-TY for emacs-devel@gnu.org; Sat, 28 Jul 2018 18:20:44 -0400 Original-Received: from mail-lj1-x229.google.com ([2a00:1450:4864:20::229]:40350) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fjXZo-0004Jn-JU for emacs-devel@gnu.org; Sat, 28 Jul 2018 18:20:40 -0400 Original-Received: by mail-lj1-x229.google.com with SMTP id j19-v6so7347559ljc.7 for ; Sat, 28 Jul 2018 15:20:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=1eXXAsTyJE0KZ5f0d7DMRcdTSTsGFta0p314hYa8KJM=; b=fjhfr+3vjcd5GtPDlmXfQJ9PX2drTjOc8ZKUhU7g9ulUIK+SGHx2yQ/s5OPDllv0e9 eJnVX9XGqzOYFIJ/p9kA9fHDGzc6bpbVuGN4bgSA3dtvQ9oZ8qTPZZ8h/8ZCOSee4STT 3bT9V7wSusUm88P+/qdYIkMO30IWg6P9UjnBC1Oec9OJ6njwCgawhEf+GVfPAINfHdVM dVPHxgJtDuDxB/jcUni2hCdTIbS3UHju4ynJvUNG7I6HRBICO/Tv3zJmuPFLSfH+1GQi UMGElxfWNXjPvcjA82Gan38T1L50IcQ56IpA2iF0UDtl094eN3FGove5iY3s95Jh9ZQm y3MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=1eXXAsTyJE0KZ5f0d7DMRcdTSTsGFta0p314hYa8KJM=; b=WdWhlEPKvmOk+J6Wwtt2P1bbtshw68rcAOYWBBp7/n+2Jomkudf/2Xgd1bmMafH3fi CuKPJggLnkOYg+CCa9UwYle8FxfYqX8Ni+HQZDbnRCmQC+5TrVIVxxOuvWJzeZhoNW13 HCSEyhX8VYomL6j5PfzvcJ+O4vVIDXUPvQU5vSXxrc9zoCIXBZMDI2bwK29hnA7u9a/i 4aclzJ6aHko9b2Bi/hpF+PbFH3C2F+N4Y87aev9f0PJxOMgUdIqbrZt5u4xnlORlBcte P084eMpkj4rO/Mzm60Yx94bYrjpiogV9vTIR5OI3zQqVxVYF/lpy3o/XtLAMLMJkRFDc SZyA== X-Gm-Message-State: AOUpUlGfQZcSHwo9ZoPIXyLz+LvNEWLjaNaIqRpxQ6Z5Bfjfk3bNFkEm zuPROBVE7CbaFNW28oovkS+aHyqt X-Google-Smtp-Source: AAOMgpcmuKfneG1Y9RvY+VCK4yIP2U8MTrUefQ/c+HycCS+eqGuwci0i7SBqonR5LK7DAgV354je2w== X-Received: by 2002:a2e:5bc8:: with SMTP id m69-v6mr9333201lje.115.1532816437318; Sat, 28 Jul 2018 15:20:37 -0700 (PDT) Original-Received: from [192.168.1.174] ([178.252.127.223]) by smtp.googlemail.com with ESMTPSA id m4-v6sm1004339lfc.48.2018.07.28.15.20.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 28 Jul 2018 15:20:36 -0700 (PDT) In-Reply-To: <87wotfhdn2.fsf@gmx.de> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::229 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:227932 Archived-At: On 7/28/18 1:13 PM, Michael Albinus wrote: > Dmitry Gutov writes: > >> No objections from me in principle, but we should probably call >> vc-file-clearprops right away (is there a chance that some other code >> calls vc-state before this thread launches and gets stale status?). > > I've scanned the Emacs lisp dir, and there doesn't seem to be any other > call to vc-state. If I'm not mistaken. Third-party code can do that, too. Such as diff-hl, and other packages not in GNU ELPA. I don't know if any of them call vc-refresh-state, but it would be nice if (progn (vc-refresh-state) (vc-state)) always returned a predictable, up-to-date result. >> We could also make vc-state use the same mutex, in order for it to >> wait until refresh finished, instead of returning the stale result. > > Well, you are much more experienced with vc than I do. Look at the > changes I've done in vc-hooks.el, and adapt. I'm not well-versed on the use of Emacs threads, though. Yet. > The only other relevant change I've done is, that I lock the vc-mutex in > find-file-with-threads of files.el. This reorders the threads, all > vc-refresh-state calls are performed after all files (from a wildcard) > are loaded into their respective buffers. This improves early visibility > of the visited files. Do we actually want one global mutex? What if we had one mutex per file? Doing those process calls in parallel would be faster, no?