1 / 5

Overview and Discussion of Lab 2 Design

Overview and Discussion of Lab 2 Design. Expand the work from a single scene to entire play I.e., process a sequence of scene configuration files Some threads will perform parts from the current scene Other threads will be loading parts for the next scene

ziv
Télécharger la présentation

Overview and Discussion of Lab 2 Design

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Overview and Discussion of Lab 2 Design • Expand the work from a single scene to entire play • I.e., process a sequence of scene configuration files • Some threads will perform parts from the current scene • Other threads will be loading parts for the next scene • A director thread/role will coordinate all those activities • Extend concurrency architecture from monitor object to thread pools using HSHA and/or LF patterns • Some or all roles may bind to a specific thread or vice versa (HSHA) or threads may take turns playing roles (LF) • Lab 3 will add distribution and service configuration • Thread pools on different machines will be coordinated • May leverage lab 2 thread architecture (think ahead) • Support reconfiguration on-the-fly (states of operations)

  2. From A Scene to a Play (HSHA version) • 3 main activities • Loading parts • Reciting lines • Coordination • Play and players • As in lab 1 • Thread pool (new) • After completing a part, return to pool • Director (new) • Recruits threads from pool to load and perform parts Director [act ii scene 1] [act ii scene 2] King P K Polonius R Q P R Queen R G Reynaldo P K Rosencrantz R Q P G Guildenstern R Q P R P R P

  3. From One Scene to the Next (LF version) • When part ends • Thread could go fetch its own work • But needs to know what to do next • Still want scenes encapsulated • Director as a role • Threads could be “self-directed” • I.e., look up next task (become the director) rather than wait for a cue Director [act ii scene 1] [act ii scene 2] King P K Polonius R Q P R Queen R G Reynaldo P K Rosencrantz R Q P G Guildenstern R Q P R P R P

  4. Key Design Considerations • Whether to use HSHA or LF • Think about what benefits and risks are involved • E.g., design/debugging complexity vs. performance vs. … • How to relate short- and long-running activities • E.g., loading a part from a file while other threads are reciting lines, synchronizing on condition variable, returning to the thread pool, taking on a new role, … • Design decisions are again largely yours to make • If the specification differs from what you think should be done, please ask about and/or suggest new ideas • If it’s a reasonable alternative, I’ll approve it in advance • Take notes as you go, write up design in your lab report

  5. Some Suggestions • Evolve (and debug) your solution incrementally • Start with as much of lab 1 as is working well • Add and test thread pool semantics for a single scene • Add and test director coordination for a single scene • Add and test director coordination for multiple scenes • Add and test advanced features (leader election, barriers to restrict migration of threads between scenes, etc.) • Please start early so I can be of the most help in answering questions, discussing ideas, etc. • Where to put the threads will require key choices • Those choices may affect how rest of design evolves • Some choices may need to be revisited (modularity helps)

More Related