click below
click below
Normal Size Small Size show me how
2.1.5
| Question | Answer |
|---|---|
| Thinking Concurrently | Single threaded programs Multiple threaded programs |
| Single threaded programs | can be traced with 1 finger, jumping off to subprocedures sometimes |
| Multiple threaded programs | would have multiple fingers tracing it at the same time. |
| Parallelism | (a form of concurrent processing on multiple cores) multiple tasks, or multiple parts of a single task, are actually running simultaneously through multiple cores actually running at the same time |
| Concurrency | when a multiple-threaded program is run by time slicing, meaning that they are in progress at the same time, but not being executed simultaneously A program is considered concurrent if it can support two or more actions in progress at the same time. |
| Concurrent processing pros | Reactive programming Availability of services (a long-running task won’t delay short-running ones) Parallelism Controllability Overall No. tasks completed in a time frame increased Wasted processor time reduced |
| Reactive programming (concurrent processing) | user can interact with applications while other tasks are running |
| Controllability (concurrent processing) | a task requiring preconditions to proceed can be suspended and resumed later |
| Concurrent processing cons | Safety (possibility of corrupting consistent state of a program) Deadlock Resource consumption |
| Deadlock (concurrent processing) | where every thread is waiting for another to complete, so none can run |
| Resource consumption (concurrent processing) | threads use up many resources and can become expensive |