Please enable JavaScript.
Coggle requires JavaScript to display documents.
OS Support (Communication and invocation (RPC delay vs requested data size…
Operating system layer
-
-
Core OS components
-
Thread manager
Handles the creation, synchronisation + scheduling of one or more threads for each process
-
-
-
Supervisor
Handles privileged operations - those that directly affect shared resources (e.g. to and from an I/O device)
-
Protection
-
-
OS kernel
Begins execution soon after the host is powered up and continues to execute while the host is operational
-
-
How it works
- Kernel puts processor into user mode
- Kernel assigns processor time to the user process
- User process accesses a kernel resource using a system call - exception that puts the processor into supervisor mode and returns control to the kernel
-
Processes
-
-
Resource sharing / interprocess communication required for threads to access resources in other processes
Shared memory
-
Can be used for two identical objects being stored e.g. libraries, kernel
Faster: no overhead of marshaling, transmission and unmarshalling
-
-
-
-
-
-
-
Threads
-
-
-
Threads within clients
-
-
E.g. web browser: user can interact with current page while the next page is being from the server. Multiple threads used to fetch each image in the page, where each image may come from a different server
Thread programming
A new thread created on the Java virtual machine as its creator, in the SUSPENDED state -> made RUNNABLE when start() and run()
-
-
Scheduling
Preemptive: running thread is suspended any time to allow processor time for other threads; usually periodically
Non-preemptive: running thread will continue to receive processor time until the thread yields control back to the thread scheduler
-
Might lead to starvation: no guarantee other threads will receive processor time -> lower performance and usability
Implementation
-
If no kernel threads, user can manage user threads within a process
-
-
If causes a page fault, will block entire process + all other threads in that process
User threads within diff processes cannot be scheduled according to a single scheme of relative prioritisation
-
User thread scheduler can be customised by the user to be specific for the given application ->can usually allocate more threads than kernel threads
-
-