synchronization in gcj

Date view Thread view Subject view Author view

From: Godmar Back (gback@cs.utah.edu)
Date: Wed Jan 13 1999 - 15:25:59 EST


 Hi,

I have a question about gcj's use of synchronization.
gcj uses an extra word to store a ptr to the lock associated with an object.

While this speeds up operations such as
a) looking up the lock
b) looking up the lock when entering it recursively
c) looking up the lock when leaving it,

it also introduces the obvious cost of having to waste 4 bytes of
memory for each object, which may be significant.

My question is then: what was your rationale, and have you considered
making the additional storage requirement optional so that users
can decide that space-time trade-off for themselves.

I believe this should be seen in the light of the fact that at least
c) can be optimized without reserving storage with each object, namely
by keeping track of matching lock/unlock pairs.

What do you think?

        - Godmar


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:41 EDT