]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Added information about setprofile() and settrace() hooks being thread-
authorFred Drake <fdrake@acm.org>
Tue, 16 Oct 2001 14:54:22 +0000 (14:54 +0000)
committerFred Drake <fdrake@acm.org>
Tue, 16 Oct 2001 14:54:22 +0000 (14:54 +0000)
specific, and updated some of the comments about the profile hook.
This closes SF bug #471725.

Doc/lib/libsys.tex

index 6e880ea0165c7e965b2a1092464a86fa7dcfd5e1..09891e024b2c36ceb528c6d695f9f7be1b8c29bd 100644 (file)
@@ -369,7 +369,11 @@ else:
   information on the Python profiler.  The system's profile function
   is called similarly to the system's trace function (see
   \function{settrace()}), but it isn't called for each executed line
-  of code (only on call and return and when an exception occurs).
+  of code (only on call and return, but the return event is reported
+  even when an exception has been set).  The function is
+  thread-specific, but there is no way for the profiler to know about
+  context switches between threads, so it does not make sense to use
+  this in the presence of multiple threads.
   Also, its return value is not used, so it can simply return
   \code{None}.
 \end{funcdesc}
@@ -389,7 +393,10 @@ else:
   Set the system's trace function,\index{trace function} which allows
   you to implement a Python source code debugger in Python.  See
   section \ref{debugger-hooks}, ``How It Works,'' in the chapter on
-  the Python debugger.\index{debugger}
+  the Python debugger.\index{debugger}  The function is
+  thread-specific; for a debugger to support multiple threads, it must
+  be registered using \function{settrace()} for each thread being
+  debugged.
 \end{funcdesc}
 
 \begin{datadesc}{stdin}