CSC369H1 Study Guide - Midterm Guide: C Dynamic Memory Allocation, Mmap, Sbrk

135 views4 pages

Document Summary

In one sentence, explain why. (if you disagree that the statement is false, provide your reasoning. ) Malloc sometimes calls sbrk or mmap which are system calls, but often malloc operates only as a function call. The data structures it manages are at user-level, and it only needs to make a system call if it runs out of memory to allocate. [1 mark] an advantage of threads is that all threads can access the entire address space. [1 mark] locks and semaphores are identical structures. More than one thread can pass through a sem wait call if the value of the semaphore is greater than 1. (they need to say something that shows that they know what sempahores are. ) Part (d) useful work to operating system overhead) as a system which uses non-preemptive scheduling. [1 mark] a system which uses a preemptive scheduling algorithm is just as e cient (ratio of.