Lec19 Process Management-III (Arif Butt @ PUCIT)


This is a continuation of previous two sessions on process management. Today we will discuss the exec() family of functions that are used to overwrite the calling process address space with a new program. We will discuss the impact of fork() and exec() on different process attributes. We will write down our own system() function and use it to create a shell utility. The session will terminate with a discussion on process groups, process sessions, and controlling terminals.

Email: arif@pucit.edu.pk
Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec20 Design and Code Of Daemon Processes (Arif Butt @ PUCIT)


This session gives an overview of daemon processes in Linux. Writing your own daemon process programatically. Introduction to systemd (replacement of SysV init daemon). Controlling daemons using systemctl utility. Writing long lived process and managing it using systemctl

Email: arif@pucit.edu.pk
Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec21 Process Scheduling Algorithms (Arif Butt @ PUCIT)


This session gives an overview of process scheduling algorithms used in Linux. It starts with a quick recap of some standard scheduling algorithms and the UNIX SYS-VR3 process scheduler. Then the working of Linux O(1) scheduler is discussed in detail. After this the working of the latest Linux Completely Fair Share (CFS) scheduler is discussed. Finally accessing and changing scheduling parameters on the shell using schedtool and from within a C program using Linux API are practically shown.

Email: arif@pucit.edu.pk
Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec22 Design And Code Of UNIX Shell Utility (Arif Butt @ PUCIT)


This session gives an overview of working of UNIX bash shell utility. The features of bash shell are discussed in detail. The famous questions of What the Shell do? and How the shell do it? are addressed. Finally some basic versions of a shell program are designed and developed. Remaining some versions are discussed but writing their code is left as an assignment.

Email: arif@pucit.edu.pk
Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec23 Multi Threaded Programming (Arif Butt @ PUCIT)


This session gives an overview of concurrent programming using pthread NPTL library. Conventional Concurrent Servers and their Problems are discussed. Available thread implementation models. Linux implementation of POSIX threads (LinuxThreads and NPTL). Thread creation and termination, joining threads, passing implicit data types to thread function, and passing structures to thread function. Returning and receiving data from a thread function. Creating Thread arrays on stack, and creating thread arrays on heap. Thread attributes (detachstate, stackaddr, stacksize, priority, inheritsched). Changing the default attributes of a thread. Threads and signals. Threads and fork(). Thread cancellation

Email: arif@pucit.edu.pk
Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec24 Overview Of UNIX IPC And Signals On The Shell (Arif Butt @ PUCIT)


This session gives an overview of taxonomy of UNIX Inter Process Communication. Describing briefly the communication, synchronisation and the signals categories and their further subcategories. The persistence of different IPC objects is discussed. Finally there is a quick recap of the concept and use of standard signals on the shell

Email: arif@pucit.edu.pk
Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec25 Design and Code Of Signal Handlers (Arif Butt @ PUCIT)


This session is a continuation of previous session in which we discussed signals on the shell. This session deals with different system calls to send signals to a process using kill(), raise(), abort(), pause(), alarm(), sleep(), usleep(), nanosleep() functions. Ignoring and handling signals using signal() system call. Avoiding race conditions using signal mask and sigprocmask() system call. Limitations of signal() system call. Ignoring and handling signals using sigaction() system call

Email: arif@pucit.edu.pk
Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec26 Programming UNIX Pipes (Arif Butt @ PUCIT)


This session deals with the concept and use of pipes in a C program using the pipe() system call. How to use a pipe for IPC among related processes for unidirectional communication. The concept of using two pipes for bidirectional communication is also discussed and a proof of concept is given by a sample program. Finally a C program code is discussed that simulate the shell command man ls | grep ls | wc

Email: arif@pucit.edu.pk
Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src

Lec27 Programming UNIX Named Pipes (Arif Butt @ PUCIT)


This session deals with the concept and use of named pipes or FIFOs in a C program using the mkfifo() and mknod() system call. How to use a named pipe for IPC among un-related processes for unidirectional communication. The concept of using two named pipes for bidirectional communication is also discussed and a proof of concept is given by a sample program

Email: arif@pucit.edu.pk
Example Codes: https://bitbucket.org/arifpucit/spvl-repo/src