This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Locking of global variables
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Mike Mason <mmlnx at us dot ibm dot com>
- Cc: systemTAP <systemtap at sources dot redhat dot com>
- Date: 10 Aug 2007 22:08:58 -0400
- Subject: Re: Locking of global variables
- References: <46BCE303.90506@us.ibm.com>
mmlnx wrote:
> If I access (read or write) a global variable in a probe handler,
> how long is it locked? From looking at the generated code, I think
> it's locked until the handler returns. Does this mean we should
> avoid the use of globals whenever possible?
Yes.
> I'm asking because I'm considering doing something like the
> following to minimize code duplication in a set of probes handlers.
> [...]
A better way would be to use (wait for) the preprocessor macros.
- FChE