View on GitHub

os202

HOME


Top 10 List of Week 06

  1. Concurrency
    Concurrency is the interleaving of processes in time to give the appearance ofsimultaneous execution. Thus it differs fromparallelism, which offers genuine simultaneous execution. However the issues and difficulties raised by the two overlap to a large extent:
    •sharing global resources safely is difficult
    •optimal allocation of resources is difficult
    •locating programming errors can be difficult, because the contexts in whicherrors occur cannot always be reproduced easily

  2. Parallelism
    Parallelism also introduces the issue that different processors may run at differ-ent speeds, but again this problem is mirrored in concurrency because different processes progress at different rates.

  3. Deadlock
    Deadlock is defined as the permanent blocking of a set of processes that either compete for global resources or communicate with each other. It occurs wheneach process in the set is blocked awaiting an event that can be triggered onlyby another blocked process in the set.

  4. Many to Many Model
    In this model, we have multiple user threads multiplex to same or lesser number of kernel level threads. Number of kernel level threads are specific to the machine, advantage of this model is if a user thread is blocked we can schedule others user thread to other kernel thread. Thus, System doesn’t block if a particular thread is blocked.

  5. Many to One Model
    In this model, we have multiple user threads mapped to one kernel thread. In this model when a user thread makes a blocking system call entire process blocks. As we have only one kernel thread and only one user thread can access kernel at a time, so multiple threads are not able access multiprocessor at the same time.

  6. One to One Model
    In this model, one to one relationship between kernel and user thread. In this model multiple thread can run on multiple processor. Problem with this model is that creating a user thread requires the corresponding kernel thread.

  7. Makefile
    Makefile is a set of commands (similar to terminal commands) with variable names and targets to create object file and to remove them. In a single make file we can create multiple targets to compile and to remove object, binary files.

  8. Fork
    Fork system call is used for creating a new process, which is called child process, which runs concurrently with the process that makes the fork() call (parent process). After a new child process is created, both processes will execute the next instruction following the fork() system call. A child process uses the same pc(program counter), same CPU registers, same open files which use in the parent process. It takes no parameters and returns an integer value. Below are different values returned by fork().

  9. Difference between fork() and exec()
    •Fork() creates a new process by duplicating the calling process, The new process, referred to as child, is an exact duplicate of the calling process, referred to as parent. On success, the PID of the child process is returned in the parent, and 0 is returned in the child. On failure, -1 is returned in the parent, no child process is created, and errno is set appropriately.
    •The exec() family of functions replaces the current process image with a new process image. It loads the program into the current process space and runs it from the entry point.

  10. Sleep
    sleep command is used to create a dummy job. A dummy job helps in delaying the execution. It takes time in seconds by default but a small suffix(s, m, h, d) can be added at the end to convert it into any other format. This command pauses the execution for an amount of time which is defined by NUMBER.