|Instrumenting multithreaded applications email@example.com (Matthew Legendre) (2003-01-21)|
|Re: Instrumenting multithreaded applications firstname.lastname@example.org (2003-01-25)|
|Re: Instrumenting multithreaded applications email@example.com (Dmitry A.Kazakov) (2003-01-25)|
|Re: Instrumenting multithreaded applications firstname.lastname@example.org (John Stracke) (2003-01-25)|
|Re: Instrumenting multithreaded applications bobduff@World.std.com (Robert A Duff) (2003-01-25)|
|Re: Instrumenting multithreaded applications email@example.com (Ben Elliston) (2003-01-25)|
|Re: Instrumenting multithreaded applications firstname.lastname@example.org (Joachim Durchholz) (2003-01-25)|
|Re: Instrumenting multithreaded applications email@example.com (David Chase) (2003-01-25)|
|Re: Instrumenting multithreaded applications firstname.lastname@example.org (Lex Spoon) (2003-01-25)|
|[1 later articles]|
|From:||Dmitry A.Kazakov <email@example.com>|
|Date:||25 Jan 2003 00:44:25 -0500|
|Keywords:||performance, testing, parallel|
|Posted-Date:||25 Jan 2003 00:44:25 EST|
On 21 Jan 2003 00:14:44 -0500, Matthew Legendre
>Does anyone have any experience with or know of any work related to
>instrumenting a multithreaded application?
>We've got a situation where we want to insert instrumentation into a
>multithreaded application (for profiling purposes). We need to use some
>form of mutual exclusion since the instrumentation writes to a global data
>The problem is that we may insert instrumentation into a signal handler.
>So a thread may enter the instrumentation code and open the appropriate
>lock. A signal then fires and transfers control to the signal handler.
>The thread then re-enters the instrumentation and deadlocks on a lock it
>I've already seen a paper by people on the Paradyn project at the Univ. of
>Wisconsin called 'Dynamic Instrumentation of Thread Applications' in which
>they suggest creating a locking mechanism that won't let a thread block on
>or enter a lock that it already has open. Unfortunately this involves
>knowledge of the underlying threading package, and I'd like to avoid
>opening that can of worms.
What you need from the underlying threading package is only thread
identification. If you have thread ID you can track down lock owner to
However it is generally a bad idea to hold a lock for a long period of
time. A better approach could be rendezvous (as in Ada) with some
dedicated thread or a queue to the thread. In the latter case lock is
taken only to put a message into the queue. Alternatively, you can
consider splitting your protected operation into two (or more) each
protected by its own lock, so that a thread would take first the
lock1, then the lock2 etc.
Return to the
Search the comp.compilers archives again.