From 88c1e8eb76674cdd87e60bf9bc9ca3f70497df24 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Sat, 10 Nov 2007 22:13:03 +0000 Subject: [PATCH] Clarify reason for existence of track_pre_thread_ll_create/_exit. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7139 --- include/pub_tool_tooliface.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/pub_tool_tooliface.h b/include/pub_tool_tooliface.h index b836833b62..0cfafa56d9 100644 --- a/include/pub_tool_tooliface.h +++ b/include/pub_tool_tooliface.h @@ -573,6 +573,21 @@ void VG_(track_stop_client_code)( ll_exit: low level thread exit. Called after the exiting thread has run its last instruction. + + The _ll_ part makes it clear these events are not to do with + pthread_create or pthread_exit/pthread_join (etc), which are a + higher level abstraction synthesised by libpthread. What you be + sure of from _ll_create/_ll_exit is the absolute limits of each + thread's lifetime, and hence be assured that all memory references + made by the thread fall inside the _ll_create/_ll_exit pair. This + is important for tools that need a 100% accurate account of which + thread is responsible for every memory reference in the process. + + pthread_create/join/exit do not give this property - they will + calls/returns to/from them happen arbitrarily far away from the + relevant low-level thread create/quit event. In general a few + hundred instructions; hence a few hundred(ish) memory references + could get misclassified each time. */ void VG_(track_pre_thread_ll_create)(void(*f)(ThreadId tid, ThreadId child)); void VG_(track_pre_thread_ll_exit) (void(*f)(ThreadId tid)); -- 2.47.2