From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x231.google.com (mail-lj1-x231.google.com [IPv6:2a00:1450:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id AD312386EC43 for ; Mon, 10 Aug 2020 06:33:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AD312386EC43 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=2ndquadrant.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=craig.ringer@2ndquadrant.com Received: by mail-lj1-x231.google.com with SMTP id h19so8278549ljg.13 for ; Sun, 09 Aug 2020 23:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/3Oso3jhj6S7/xTgwxIfyFw3h3Krs1b0c3pQQ/wswh0=; b=iMl/+ht+JmRsizaJMA7VzBqZQLs5SQvyRi5DI3XTufq0k78l80kqnUTXWjpjTuMdz4 LiDaat4YZ8FRWQtdbPsZgYdk6vKhUnsolJJMWhNnpt4ohzr8t5YY8VRksRYIpLMV4k1a bAe+nG/DNfq+x8NwqCZINPPd32Q4pm2vdbY5XA8Ep/TJZ8UxM/bSF0USNOmYAVf+iQVD 7XcGKlPrCS75zt/YADVNWmy/F5V9M+pbEZ2GRSZJirMC/gUR66fsm0pQlOaziZ5HDii/ gx9HfM5tNJXH3IykXJ2TbfZqma9f5y0Um2RhAJ+egM0CBjZ5LoscoAuXT0W+PUVLMEQf R0Wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/3Oso3jhj6S7/xTgwxIfyFw3h3Krs1b0c3pQQ/wswh0=; b=fKxxIrAMz9QmwExgjmqdQT62gGAyyg6OwcnmAMVNElYYFXtj1sc/skYoKGZ3vIB6hs +HUhr1Ej5jWlqR7ZeEOwYepZLZ1TGXsKC1zU7OLyPR4yQUdUab5XC1B+po0fgXYY8HGX 4Ogz8PdjPpgVOvRGYC3TqC+b4VRKnnepsYokOkeB6FH4+f28lQ4/Id1D8EbQSa8QV0+u o5N/DBDEQ9r/rHwhP58X3VwkIen1f+VJMraUsnVhiLRLzUGQOM6amJDwpmj6GnHQzR3p KfR1vDTZkgpU3n4TtDA1WWn4zlW/MGaO0oiVO4CdAfarfyuCoXqkJ9bPgDnxEAu9aKY2 R3FQ== X-Gm-Message-State: AOAM532wYVQOjzi07l+N5uB579b09o7W8yGTaQqQIphAi4GG/inLSprj KNs93FiJJHcnYbHNz1Y+3RtN+roYvPTysvHoGPVI+nTKBn8= X-Google-Smtp-Source: ABdhPJyvDQ4fNX5efSnRs2cceqnmE6Ugfmar5y4UHsgHaOEv9cLkaFdRD49wdhNCtmdtPJiU/xCirI1Az4hgdEYsFWI= X-Received: by 2002:a2e:3609:: with SMTP id d9mr11092034lja.106.1597041180041; Sun, 09 Aug 2020 23:33:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Craig Ringer Date: Mon, 10 Aug 2020 14:32:47 +0800 Message-ID: Subject: Re: [Bug translator/26296] delay script-global locking until required To: fche at redhat dot com Cc: systemtap@sourceware.org X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Aug 2020 06:33:03 -0000 On Wed, 5 Aug 2020 at 03:59, fche at redhat dot com via Systemtap < systemtap@sourceware.org> wrote: > https://sourceware.org/bugzilla/show_bug.cgi?id=26296 > > --- Comment #3 from Frank Ch. Eigler --- > > Even an explicit construct that scopes locking would be handy. Borrow > from > > Java's "synchronized" perhaps. > > If one can come up with easy-to-explain, implementable, safe > semantics, yeah perhaps! > I'm thinking something like this: * Explicit locking is scoped to a block * Locks are acquired against a named global variable * Within a scope that uses explicit locking, ab attempt to access global variables for which locks have not been explicitly acquired is a semantic error * Any exit from a block - "next", "return", throwing an exception, etc - releases the lock at escape from the block. * A warning will be raised during compilation if any given global is accessed under explicit locking in one part of a script or tapset, but via implicit probe level locking in another part. Deadlock protection is a bit interesting. I haven't looked at how systemtap takes care of that at the moment. If it can detect deadlock and fail gracefully that's probably sufficient. Of course it's all handwaving unless I have time to write it, since I don't get to ask others to. And I'm a bit stuck in C++ error message spam in the relatively simple patch I wrote for @enum already... -- Craig Ringer http://www.2ndQuadrant.com/ 2ndQuadrant - PostgreSQL Solutions for the Enterprise