From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D4877386EC45; Mon, 10 Aug 2020 06:33:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D4877386EC45 From: "craig at 2ndquadrant dot com" To: systemtap@sourceware.org Subject: [Bug translator/26296] delay script-global locking until required Date: Mon, 10 Aug 2020 06:33:04 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: craig at 2ndquadrant dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 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:04 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D26296 --- Comment #4 from craig at 2ndquadrant dot com --- 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=3D26296 > > --- 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... --=20 You are receiving this mail because: You are the assignee for the bug.=