2.3/2.4/2.5 Flashcards
(15 cards)
top down modular design
solving a larger problem by breaking it down into a top down modular design using stepwise refinement task is split into smaller subtasks
aim to end up with sub tasks that perform a single function or task
advantages of top down modular design
makes problem easier to solve as subtasks are smaller and simpler
may be reusable
breaking it down helps see what needs to be done
more than one person can work on a task at a time
passing parameters by value
value for subroutine is created as a copy for the original
once it’s passed in parameter is held in a seperate memory location and is only available to that subroutine
the copy is now a local variable of that subroutine
passing parameters by reference
a pointer that contains the memory address of the original variable is created this means that any changes to that value from within the called subroutine will not affect the value of the original variable
identifying sub procedures
sequence of steps grouped together and given its own name
order in which operations are to be performed is important
several can be executed simultaneously within a program
some require data from other subroutines
determining logical decision
should be clear what sort of approach is best for achieving your solution
evaluate conditions, convenience, responsibility, importance
parallelism
can support 2 or more actions executing at the same time
benefits of parallelism
performance increase for graphics processing
several tasks performed simultaneously
trade offs of parallelism
overhead associated with using more than one processor/core
concurrency
a program is running more than one process at the same time
benefits of concurrency
users can interact with applications with other tasks are running
availability of services
long running task won’t delay short running ones
controllability
task requiring preconditions to proceed can be suspended and resumed later
resource consumption
threads can consume resources in regard to scheduling, context, context switching and synchronisation
non determinism
mastering an exponential number of interleaving due to different schedules