• Post Reply Bookmark Topic Watch Topic
  • New Topic

Changing Class Layouts at Runtime  RSS feed

 
Roger Krampfer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will be required to adapt the memory layout of classes dynamically (e.g. after reaching a certain threshold or other) at runtime.
A change can include moving fields around, embedding objects into the class as new fields and changing the fields' sizes. (Not necessarily all three at the same time.)

In addition to Bytecode Instrumentation in general, what else will I have to familiarise myself with?

Does anybody know of projects that have done such a thing before?

(Ps: Not sure whether this belongs into here or into the performance subforum. Will post it here for the time being.)
 
Tim Moores
Saloon Keeper
Posts: 4032
94
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the purpose of doing this?
 
Campbell Ritchie
Marshal
Posts: 56545
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
. . . and welcome to the Ranch
 
Roger Krampfer
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Moores wrote:What is the purpose of doing this?

I'll be working on a framework that inserts per-field locks into classes for use in a transactional system that hides the synchronization from the programmer, thereby (hopefully) making it easier to write correctly synchronized programs.
Current implementation inserts an array of fixed-size locks, which has several drawbacks.
We're hoping to find a suitable heuristic that will tell us when inlining the locks yields better performance.
Also, the fixed-size locks artificially limit concurrency (because they limit the amount of IDs we can hand out to threads), so we'd also like to "grow" them, when necessary.

Campbell Ritchie wrote:. . . and welcome to the Ranch

Thank you.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!