On Fri, 28 Oct 2022 01:47:23 GMT, David Holmes <dhol...@openjdk.org> wrote:

> So the data structure for lock records (per thread) could consist of a series 
> of distinct values [ A B C ] and each of the values could be repeated, but 
> only adjacently: [ A A A B C C ] for example.
> @rose00 why only adjacently? Nested locking can be interleaved on different 
> monitors.

Yes it can; you can have nesting A, B, A.  But the thread-based fast-locking 
list might not cover that case.  If it were restricted to only adjacent records 
in the way I sketched, it would need to use a different, slower technique for 
the A, B, A case.  The trade-off is that if you only allow adjacent recursive 
locks on the list, you don't need to search the list beyond the first element, 
to detect re-locking.  Dunno if that pencils out to a real advantage, though, 
since the fallback is slow.

-------------

PR: https://git.openjdk.org/jdk/pull/10590

Reply via email to