You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/05/19 11:11:48 UTC

[GitHub] [qpid-dispatch] jiridanek commented on a change in pull request #805: Proposal for run-time lock validation

jiridanek commented on a change in pull request #805:
URL: https://github.com/apache/qpid-dispatch/pull/805#discussion_r635139016



##########
File path: docs/notes/RIPs/lock-validation.adoc
##########
@@ -0,0 +1,101 @@
+////
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License
+////
+
+= Mutex Locking Validation
+
+== Summary
+
+This RIP proposes a compile-time debug mechanism to ensure that thread
+locking is well behaved.
+
+== Introduction
+
+The Qpid Dispatch Router is a multi-threaded application.  These
+threads share state and use locks to ensure the consistency of that
+state.  The locking API is defined in
+include/qpid/dispatch/threading.h
+
+In general lock nesting (e.g. taking a lock while holding another) is
+not permitted.
+
+However in a few instances locks will nest. One example of permitted lock
+nesting is the Python lock (qd_python_lock()).  This lock must be held
+while a thread is running within the Python interpreter.  Occasionally
+the Python interpreter will invoke native C functions.  These
+functions may take addional locks, such as the global logging lock
+(log_lock).

Review comment:
       I meant something like http://logging.apache.org/log4j/2.x/manual/async.html, this keeps a queue of in-flight log messages and adding to the queue does not require holding a lock.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org