Sunteți pe pagina 1din 4

OS: Controls and coordinates the use of hardware. Proper use of the resources.

Government, no useful function by itself, It only provides the environment in which programs can do useful work. USER VIEW. Maximize resources(time, memory and T/O) utilization. SYS VIEW. Resource allocator. Management of resources. SYS GOALS. Convenience for the user . Efficient operation. BATCH SYS. New- running-finish MULTIPROGRAM.(Job and cpu schedule) Job Scheduling. Job sent to pool job(process residing on disk awaiting allocation in MM) CPU scheduling. Decide from job pool to load into Memory to execute Time-sharing(multitask). CPU execute multi jobs by switching so fast it seems as an interaction. Process: A program loaded into memory and executes MULTIPROCESSOR. More than one processor . Increased throughput(more processors, more work less time), economy of scale(Shares peripherials, mass storage and power supplies), increased reliability(a failure of a processor, then other processors share its work) Symetric MProcessing. Each processors runs a copy of the OS Asymetric Each process a specifical task. Master slave relationship Interrupt.- Something happens Trap.- Software generated interrupt Interrupt vector: table of interrupts directions Synchronous I/O. IO starts IO completes and user takes control Asynchronous. User takes control with the IO not completed Storage hierarchy. Expensive and fast (TOP). Registers. Cache. MM. Volatile Hardware protection. DUAL MODE OPERATION User mode and Monitor Mode Privileged instructions only made by monitor mode I/O Protection Defining all IO instructions to be privileged instructions Memory Protection by the use of base and limit registers

CPU protection by timer to prevent infinite loops. Process State New: Process creates Running: Executing Ready: Waiting to be assigned Waiting: 4 smth to ocurr PCB. Pointer, state, number, counter, regs, memory Job scheduler (Long) is minimal Swapper (Medium) Takes processes from MM to swapper Context switch requires saving the state f the old process and loading the saved state for a new process. It includes changing the pointer to the current register set When a parent creates a son: Child may take system or parents resources. Parent waits to its children terminates The child is a duplicate of the parent The child has a program loaded A parent may terminate child: Exceeded usage of resources Is no longer required Parent is exiting Cooperating processes. Reasons Information sharing Speedup computation Convenience Multithread. Shares code data files, each thread has a stack and its own registers Benefits Responsiveness. Continue running if a part is blocked Resource sharing. Occupies the same address space. Economy. More economical to create and context switch

Multiprocessor architectures. Each thread can be running in parallel on diff processor User and Kernel threads UT are supported and implemented by a thread library. KernelT exist apart from userT Kernel supported only by OS. Slower to create and manage. Model Many to One. Problem if one makes a syscall all the process block One to one . More concurrency. Multiprocessors. For each user thread we need a kernel and its overhead. Is faster to service a request with an existing thread A thread pool limits the number of threads existing in one point Preemptive schedule.- (Process switch from run to ready(Interrupt) Wait to ready(Completion of IO)) NonPreemptive(Run to Wait,(IO request, child dies) or Process terminates) Dispatcher, gives control of the CPU to the process selected by the CPU SCH(Switch context, user mode) SChedul Criteria CPU UTil Throughput Turnaround time Wait time Response time Time sharing sys needs minimize response time. FCFS(NP) SJF(NP) SRTF(P) RR(P) Analytic and simulation ways to model queues

BAKERY ALGORITHM Flag[i]= QUIERO ENTRAR A LA CS MIENTRAS QUE NO HAYA NADIE EN CS

do{ flag[i] = true; while (flag [ j ]) { if (turn == j) { flag [i] = false; while (turn == j) ; flag[i] = true; }

critical section

turn=j; flag[i] = false;

remainder section

} while (1); }

S-ar putea să vă placă și