215-thinking-concurrently-elements-of-computational-thinking Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Thinking concurrently

A
  • spotting dependency patterns and related parts of problems where concurrent processing can be applied/process at same time
  • tasks are broken down into sub tasks
    -situation where you want carrying out more than one task at a given time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

concurrent processing pros

A
  • possibly find solution faster, less time waiting as other tasks can be completed while perhaps waiting for user input
  • increase program throughput (processing in a given time)
  • availability of services e.g shouldnt have long running tasks delaying short ones
  • reactive programming, controllability
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

concurrent processing cons

A
  • memory intensive, threads expensive
  • if designed poorly can actually run slower than sequential counterparts even with multiple CPU cores
    -More difficult to debug and program
  • deadlock tasks indefinitely wait for each other: can occur more easily with many concurrent occurring at once
  • overhead switching and coordinating threads/communication between concurrent tasks
  • not all tasks are suited
  • longer to complete if large number of tasks involved concurrently and difficult to track to ensure consistent state of a program not corrupted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

parallel vs concurrent processing

A

concurrent single processor is switching between separate tasks so that all tasks appear to be being processed at the same time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

concurrency

A
  • can support two or more tasks in progress at same time, not necessarily simultaneously but creates the illusion when they’re being executed sequentially
  • several running processes given processor time slice.
  • carrying out more than one task at a given time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

single threaded vs multi threaded

A

Threads allow the processor to perform multiple tasks at the same time making the tasks faster. And also making the computer capable of multitasking. Due to threads only you are able to browse the web as well as listen to music simultaneously.
threads handle a specific task/ a thread opened to handle all the tasks of a specific application

single: linear execution flow, instructions one after the other, in a predetermined sequential path, executing functions in order and branching when necessary
multi: can have multiple threads of execution running concurrently, each thread has a separate flow and execution, multiple parts of the program can execute simultaneously

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Reactive programming

A

User should be able to interact with applications while other tasks are running in the background.
all OSes are built like this to support concurrency

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Parallelism vs concurrency

A

concurrent is support actions in progress at the same time. dealing with lots of things at once.
-parallel is actions executing. simultaneously. doing lots of things at once.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

controllability

A

task that might require certain preconditions to proceed could be suspended and then wait until those preconditions are met before resuming execution transparently

How well did you know this?
1
Not at all
2
3
4
5
Perfectly