Lesson 6: Multi-threading and Concurrent Programming Flashcards
Scheduling algorithms do not determine when to stop one process and give CPU
time to another process. True or false?
False, they DO determine
A thread can be created by extending the Thread class, or by implementing the Runnable interface. True or false?
True
The process is using the CPU (it has been allocated processor time and the processes machine code is physically executed by the processor.)
Running
Transition 2 is usually triggered by a processor interruption signal generated by the corresponding I/O peripheral or a network interface. True or false?
False, Transition 4
The use of uni-programming was a feasible solution for the early computers. True or false?
True
Current CPU architectures
require less processing units (cores), which increase the parallel processing capacity of the machine. True or false?
False, involve multiple processing units (cores)
Less complex and faster than process context switching, making multi-threading an efficient way to emulate parallelism.
Thread context switching
A transition is caused by the process scheduler when it decides to give a ready process the chance to run.
Transition 3
The process is ready to run (does not have to wait for any event to occur), but it is temporarily stopped
Ready (Runnable)
Non-preemptive scheduling usually happens when the currently running process has to switch to the BLOCKED state, while waiting for an external event. True or false?
True
In this software approach,
parallel processing requires
that the operating systems
perform fast switching of CPU
between different processes.
Multi-tasking paradigm
Thread priorities have to be managed according to the application purpose and requirements. True or false?
True
Shortest remaining job first involves giving priority to processes which are about to
finish their operation, leading to a faster de-congestion of the process queue. True or false?
True
This method of the Thread class is overridden here to perform the core activity of the tasks.
run()
The first process in the queue of READY process will be allocated processor time.
First come–first served
When multiple threads exist,
different tasks can be performed in parallel using common data and resources. True or false?
True
The solution to the uni-programming problem is represented by the
multi-tasking paradigm. True or false?
False, multi-programming
The processes requiring the
shortest time to complete will be given the highest priority.
Shortest remaining job first
A thread which manages time-critical tasks should be given lower priority than the other threads. True or false?
False, higher priority
Threads may be allocated different priorities
depending on their role within the application process. True or false?
True
Transitions 2 and 3 are basically creating an illusion of processing parallelism. True or false?
True
Despite the evident benefits multi-threading brings, in terms of application design, the number of threads should be kept to the minimum, in order not to overload the system with non-necessary context switches. True or false?
True
A call to this method determines the threads to suspend their execution.
sleep()
Emerged as a processor allocation paradigm
where multiple user programs run on the same computer at the same time.
Multi-programming