Distributed Computing Systems CSCI 4780/6780
Code Migration • Moving code (sometimes during execution) from one machine to another • Reasons for code migration • Load distribution and improving scalability (e. g. Java applets) • Reducing communication costs (e. g. , moving query to the database location) • Exploit parallelism (e. g. , web crawler bots) • Dynamic configuration/reconfiguration
Reasons for Migrating Code The principle of dynamically configuring a client to communicate to a server. The client first fetches the necessary software, and then invokes the server.
Strong and Weak Code Migration • Three segments of a program • Code segment • Resource segment • Execution segment • Weak mobility moves only the code segment • Strong mobility moves the other two segments as well so that the program can run on the other platform • Similar to process migration
Models for Code Migration Alternatives for code migration.
Binding • Binding by identifier • Process uses a URI for binding to a resource • Strongest type of binding • Web pages, local communication end points, file names • Binding by value • Value is needed not the exact resource • Standard libraries • Binding by type • Weakest binding • Monitor, printer, etc.
Resources • Unattached resources • Resources that can be easily moved • (Small) Data files used by a single program • Fastened resources • Possible to move but at a significant cost • E. g. ? • Fixed resources • Cannot be moved • E. g. ?
Migration and Local Resources Resource-to machine binding Unattached Process-to- By identifier resource By value binding By type Fastened Fixed MV (or GR) CP ( or MV, GR) RB (or GR, CP) GR (or MV) GR (or CP) RB (or GR, CP) GR GR RB (or GR) Actions to be taken with respect to the references to local resources when migrating code to another machine.
Migration in Heterogeneous Systems • Similarity with portability issue • Scripting and portable languages • Virtual machines that directly interpret the code or interpret intermediate code • Compartmentalization and strong mobility • Migration of virtual machines • Ways for handling memory migration • Push memory pages to the new machine and resend modified pages • Stop and start model • Pull the pages as needed