[Gc] GC_get_bytes_since_gc locks
Boehm, Hans
hans.boehm at hp.com
Tue Aug 23 11:29:30 PDT 2011
In general, yes, it is necessary. See for example my HotPar 2011 paper: http://www.usenix.org/events/hotpar11/tech/final_files/Boehm.pdf .
It probably makes sense to introduce a second version that's callable from contexts in which the lock is already held, i.e. GC_get_bytes_since_gc_inner(), which would hopefully also solve your problem.
Hans
From: gc-bounces at linux.hpl.hp.com [mailto:gc-bounces at linux.hpl.hp.com] On Behalf Of Juan Jose Garcia-Ripoll
Sent: Tuesday, August 23, 2011 5:28 AM
To: gc at linux.hpl.hp.com
Subject: [Gc] GC_get_bytes_since_gc locks
Formerly this function was very simple could be called from a routine that marks or that perform some task before or after garbage collection (one of the hooks). Now this is not the case. A useless lock has been inserted in a function that all it does is read a C variable. Really, is this necessary?
GC_API size_t GC_CALL GC_get_bytes_since_gc(void)
{
size_t value;
DCL_LOCK_STATE;
LOCK();
value = GC_bytes_allocd;
UNLOCK();
return value;
}
--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://napali.hpl.hp.com/pipermail/gc/attachments/20110823/3a6c0556/attachment.htm
More information about the Gc
mailing list