Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 532: Lab 2 design overview Overview and Discussion of Lab 2 Design Expand the work from a single scene to entire play –I.e., process a sequence of.

Similar presentations


Presentation on theme: "CSE 532: Lab 2 design overview Overview and Discussion of Lab 2 Design Expand the work from a single scene to entire play –I.e., process a sequence of."— Presentation transcript:

1 CSE 532: Lab 2 design overview 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 CSE 532: Lab 2 design overview 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 O P Polonius Ophelia Queen Guildenstern Q K G R Rosencrantz Director O P O P O P O P P King Q K G Q [act ii scene 1b] [act ii scene 2a]

3 CSE 532: Lab 2 design overview 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 R P Polonius Ophelia Queen Guildenstern Q K G R Rosencrantz Director R P R P R P R P P King Q K G Q [act ii scene 1b] [act ii scene 2a]

4 CSE 532: Lab 2 design overview 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 CSE 532: Lab 2 design overview 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)


Download ppt "CSE 532: Lab 2 design overview Overview and Discussion of Lab 2 Design Expand the work from a single scene to entire play –I.e., process a sequence of."

Similar presentations


Ads by Google