Lec28 Message Queues (Arif Butt @ PUCIT)


This session deals with the concept and use of message queues. Both System-V as well as the POSIX message queues are discussed. Data structures used by System-V message queues are described. The implementation of message queues are done using the System-V API. msgget(), msgsnd(),msgrcv(),msgctl()

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

Lec29 Programming With Shared Memory (Arif Butt @ PUCIT)


This session deals with the concept and use of shared memory. The implementation of shared memory is done using the System-V API: shmget(), shmat(), shmdt(), shmctl(). Use of ipcs, and ipcrm commands are also discussed.

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

Lec30 Memory Mapped Files (Arif Butt @ PUCIT)


This session deals with the concept and use of memory mapped files. The location of memory mappings in process address space is discussed. Comparison between private and shared file mapping. Use of mmap(), msync(), and munmap() are discussed. Finally some sample programs are discussed for a proof of concept.

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

Lec31 Synchronization among Threads (Arif Butt @ PUCIT)


This session starts with a quick recap of POSIX threads and then gives an overview of synchronization. The concept of race condition and critical section problems are discussed. Then the concept of direct and indirect data sharing among threads, threads safety and reentrant functions are described. Introduction to mutex, locking, unlocking and destroying a mutex object. Mutex attributes and mutex types. Introduction to condition variable. The concept of thread cancellation is introduced. Finally problems like producer consumer problem and barber shop problem are discussed.

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

Lec32 Programming with POSIX Semaphores (Arif Butt @ PUCIT)


This session starts with introduction to POSIX semaphores by giving a comparison between mutex, condition variable and semaphore. The implementation of named and unnamed semaphores and their API is discussed. Sample codes are discussed which gives a CSP solution using semaphores among threads and processes. The solution of serialization is also discussed among threads and processes using semaphores. Finally, the use of counting semaphores is also explained

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

Lec33 Overview Of TCPIP Architecture and Services (Arif Butt @ PUCIT)


This session starts with introduction to TCP/IP stack and addressing on different layers of TCP/IP stack. Some important NW services (ssh, telnet, echo, chargen, daytime, time, discard) are discussed. The lab environment for future sessions is described comprising of three machines running Kali Linux, Ubuntu Server and Windows 10. Finally, use of different NW configuration tools and the use of different services are shown on Linux terminal.

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

Lec34 Socket Programming Part-I (Arif Butt @ PUCIT)


This session starts with introduction to Client Server paradigm. Then a detailed comparison of TCP and UDP sockets is discussed with examples. Three way connection establishment and four way connection termination is compared and shown practically using Wireshark tool. The system call graph of Internet domain TCP Client and server is described. The related system calls for creating and managing the sockets are discussed. Proof of these concepts is given by example codes of echo and daytime clients and servers. Some important lookup functions like gethostbyname() and getservbyname() are discussed with examples. Finally, the session closes with a description of assignment on writing your own web server.

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

Lec35 Socket Programming Part-II (Arif Butt @ PUCIT)


This session starts with introduction to Datagram Sockets by giving an overview of how datagram sockets work. The system call graph of Internet domain UDP Client and server is described. The related system calls for creating and managing the sockets are discussed. Proof of these concepts is given by example codes of echo, daytime and time clients and servers.

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

Lec36 Socket Programming Part-III (Arif Butt @ PUCIT)


This session starts with introduction to UNIX domain sockets. A comparison between UNIX domain TCP sockets and UNIX domain UDP sockets is made. Proof of these concepts is given by example codes of UNIX domain TCP echo client server programs as well as UNIX domain UDP sender and receiver programs

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