03 01 Processes Part 1 — Transcript
Full transcript
- 0:08[Music]
- 0:20hi good day
- 0:23on this video lecture
- 0:24so we are going to cover discussions on
- 0:29operating system processes
- 0:33so here's the outline of the
- 0:36presentation so we are going to deal
- 0:38with the following
- 0:40so you've got a process concept
- 0:43process scheduling
- 0:45operations on processes
- 0:48the inter-process communication
- 0:51ipc or the inter-process communication
- 0:53and shared memory systems
- 0:56the inter-process communication in
- 0:58message passing systems
- 1:01so we also deal with examples of the
- 1:03inter-process communication systems
- 1:06and the communication in the client
- 1:08server systems
- 1:13all right
- 1:14so the objective of our video or
- 1:17objectives of the video so would be the
- 1:19following so first
- 1:21identify the separate components of a
- 1:24process and illustrate how they are
- 1:26represented and scheduled in an
- 1:28operating system
- 1:30okay so second is describe how
- 1:32processors are created and terminated in
- 1:34an operating system so including
- 1:37developing programs using the
- 1:39appropriate system calls
- 1:41that perform these operations
- 1:44okay so third is to describe
- 1:48and contrast the inter-process
- 1:50communication using
- 1:52shared memory and message passing
- 1:56forties design programs that uses pipes
- 1:59and posix shared memory to perform the
- 2:02inter-process communication or ipc
- 2:06so to describe the client server
- 2:07communication using sockets and remote
- 2:10procedure calls
- 2:11right and last would be to design kernel
- 2:14modules that interact with the linux
- 2:16operating systems
- 2:19so let's start
- 2:21so let's start with the definition of a
- 2:23process so what is a process
- 2:26in an operating systems
- 2:29okay so basically when you say process
- 2:31we're talking about the instance of
- 2:32program execution
- 2:35okay a process is basically
- 2:37a program in
- 2:39execution
- 2:40so process execution must progress in
- 2:43sequential fashion
- 2:45no parallel execution of instructions of
- 2:48a single process
- 2:49so basically in layman's term when say
- 2:52process
- 2:54we run the program it creates a process
- 2:57the program itself that is not running
- 2:59is not considered to be a process so you
- 3:02run the applications and that would
- 3:04become a process
- 3:06okay
- 3:07so batch systems works in terms of jobs
- 3:10so on this discussion
- 3:13the process or the term process and jobs
- 3:15are used interchangeably
- 3:17so process is also the same as jobs and
- 3:20we talk about a program in
- 3:22execution
- 3:24okay
- 3:25so many many modern process concepts are
- 3:28still expressed in terms of jobs
- 3:30that's why some books you'll be hearing
- 3:32job scheduling
- 3:34okay
- 3:35or that is also the same with process
- 3:37scheduling or we call it cpu scheduling
- 3:40okay so these terms are used
- 3:42interchangeably throughout the
- 3:44discussion here okay
- 3:46so a process basically composed of
- 3:49multiple parts
- 3:51okay so you've got the program code
- 3:54also called the text section
- 3:57so currently our current activity
- 3:59including the program counter processor
- 4:02registers okay
- 4:03so stack containing the temporal data
- 4:06so function parameters return addresses
- 4:09and local variables
- 4:11so you also have data section containing
- 4:14the global variables and the heap
- 4:16containing memory dynamically allocated
- 4:19during runtime
- 4:25okay so a program is either passive or
- 4:29active okay so program is passive entity
- 4:33stored on the disk
- 4:34this or the executable file
- 4:37okay and when you say process we're
- 4:40talking about the active
- 4:42okay active program or running program
- 4:45so that is what we call a process okay
- 4:48so program becomes a process
- 4:51only when an executable file is loaded
- 4:53into the memory
- 4:54and being executed by the cpu
- 4:57okay so execution of programs started
- 5:00via gui okay so via mouse click so take
- 5:04note that when you click on the
- 5:05application you are actually starting a
- 5:07process
- 5:08okay or in the command line you simply
- 5:11type in the command okay so just make
- 5:13sure it is executable and that creates a
- 5:15process
- 5:17right so one program can have
- 5:20several processes
- 5:22consider multiple users executing the
- 5:24same program
- 5:26okay
- 5:28next
- 5:29so this diagram here represents a
- 5:32process in a memory
- 5:34okay so basically as mentioned earlier a
- 5:37process has the following so it has a
- 5:39stack
- 5:40heap
- 5:41data and text
- 5:44okay so process memory is divided into
- 5:47this four section as you can see here
- 5:50you've got to stop the heap the data and
- 5:52the text
- 5:53so let's start with a text section
- 5:56okay so the text section comprises the
- 5:58compiled program code
- 6:00read in from a non-volatile storage when
- 6:03the program is launched
- 6:06okay
- 6:07so the next one is data section it
- 6:09stores global and static variables
- 6:11allocated and initialized prior to
- 6:13executing the main
- 6:15function in a program
- 6:16okay so that's why
- 6:18for example in c plus we'll have the
- 6:20main function
- 6:22okay
- 6:24next is the hip
- 6:26okay
- 6:27so what is a hip hip is used for dynamic
- 6:29memory allocation
- 6:31and is managed by a calls to new delete
- 6:35the malloc or the memory allocation
- 6:39free and i recommend etc
- 6:42okay
- 6:43so the next one is stack so stack is
- 6:45used for local variables so space on the
- 6:48stock is reserved for local variables
- 6:51when they are declared okay at the
- 6:54function entrance
- 6:55or maybe elsewhere depending on the
- 6:57language
- 6:58all right and the space is freed up when
- 7:01the variables go out of the scope
- 7:04okay so note that the stock is also used
- 7:07for function return values
- 7:09and the exact mechanism of stock
- 7:11management
- 7:12may be language specific
- 7:14so maybe you are
- 7:16you you still remember
- 7:18okay so programming
- 7:20all right
- 7:21so we have declaration of the local and
- 7:24global variables in there so that works
- 7:26on
- 7:27the sub
- 7:29okay so note that the stock and the heap
- 7:32start at opposite ends of the process
- 7:34free space
- 7:35and grow towards each other so you'll
- 7:37have the space here
- 7:39okay
- 7:42and if they should ever meet
- 7:44then either the stock overflow error
- 7:46will occur
- 7:48okay else a call to a new or memory
- 7:51allocation or malloc
- 7:52will fail due to insufficient memory
- 7:55available
- 7:56okay so when a process are swapped out
- 8:00of the memory and later is stored
- 8:02additional information must also be
- 8:04stored
- 8:06and restored
- 8:07so key among them are the program
- 8:10counter
- 8:11and the value of all the program
- 8:12registers
- 8:14all right
- 8:16next so i have here an example of a
- 8:19memory layout of a c program
- 8:21so this is what uh what has been
- 8:23explained
- 8:24on the previous slides or in
- 8:26every time you declare variables so
- 8:29every time we
- 8:31we declare an identifier so they are
- 8:33mapped into the memory
- 8:36okay so the lower portion of memory is
- 8:38the text so what you call the text and
- 8:41these variables here
- 8:43are occupying the other portions of the
- 8:46memory
- 8:48all right
- 8:49now so
- 8:51when you say process as i said earlier
- 8:54this is a program and execution
- 8:56okay so if we are talking about the
- 9:01processes of this computer let me show
- 9:03you that okay so let me open
- 9:05a task manager here okay
- 9:08so
- 9:10this task manager here okay shows the
- 9:13number of processors running so
- 9:15basically they are represented by
- 9:18apps okay
- 9:19you've got the user processors here and
- 9:22i also have
- 9:23here some background processes
- 9:26all right
- 9:27now in here you will observe the
- 9:30allocation of the resources
- 9:32all right
- 9:33so for the allocation of the resources
- 9:35so basically your operating system
- 9:37allocates
- 9:39the cpu
- 9:41currently i'm using 20 of it the memory
- 9:44disk network and others
- 9:47now what i want you to pay attention
- 9:49with is the performance here
- 9:52and take a look at the number of
- 9:53processes
- 9:55which are being run by this computer
- 9:58okay so let me expand this
- 10:01so we've got processes here okay and
- 10:04then performance
- 10:07all right
- 10:08so
- 10:10these are the resources available on the
- 10:12cpu when you click on the cpu you'll
- 10:15have the processes there
- 10:17right
- 10:18so currently this computer is running
- 10:21170 processes but
- 10:23if you will observe you will only see
- 10:25some of the processes here
- 10:27because majority of the processes being
- 10:30run by your computer is part of the
- 10:31system or part of the operating system
- 10:34all right
- 10:35so
- 10:36again we have processes here that means
- 10:38this computer is running
- 10:41170 program at the current state
- 10:45okay and there are about 2
- 10:48370 plus plus
- 10:50threads
- 10:52okay
- 10:53now let's talk about the process state
- 10:56okay so each process each application we
- 10:58open and run passes through this
- 11:02state
- 11:02okay so basically we're going to start
- 11:05with new
- 11:06new is when the process is created
- 11:10running
- 11:11instructions are being executed
- 11:14waiting the process is waiting for some
- 11:16event to occur
- 11:18you've got already
- 11:21the process is waiting to be assigned to
- 11:23a processor and terminated the process
- 11:25has finished the execution
- 11:27okay so representing in terms of a
- 11:29diagram here so this represents the
- 11:31process state so initially when you open
- 11:34the application we are actually creating
- 11:37a new process
- 11:39okay
- 11:40the process is in the stage
- 11:43of being created so that's what we meant
- 11:45by news
- 11:47okay
- 11:48and then once admitted onto the memory
- 11:51so it will now be in red state
- 11:54so ready means the process has all the
- 11:56resources available that it needs
- 11:58to run but the cpu is not currently
- 12:01working on its process instructions
- 12:03so basically before we run an
- 12:05application before it is considered to
- 12:08be a process
- 12:09this application needs resources or this
- 12:12process needs resources
- 12:15okay
- 12:15and once it has the resources so it is
- 12:18now in ready state
- 12:20okay
- 12:21next state is running
- 12:23so after the ready state so you've got
- 12:25the running state there the cpu is
- 12:27working on its
- 12:29process instructions now
- 12:32and then waiting here
- 12:35waiting is caused by an io or an event
- 12:37rate
- 12:38okay
- 12:40or an i o completion so and then that
- 12:43would go to ready and then running again
- 12:46now waiting is the process cannot run at
- 12:49the moment
- 12:50because it is waiting for some resource
- 12:52to become available
- 12:54or for some events occur so for example
- 12:57the process
- 12:59may be waiting for a keyboard input
- 13:01or disk access request or enter process
- 13:05messages okay a timer go off
- 13:08or
- 13:09a child process to finish
- 13:11so that is waiting state
- 13:14all right
- 13:15so next would be
- 13:17terminated so the process has completed
- 13:20its operation
- 13:23all right
- 13:24next
- 13:26now let's talk about the process control
- 13:28block
- 13:29okay so what is a process control block
- 13:32so it has the information associated
- 13:35with each process
- 13:36this is also called the task control
- 13:38block or tcb
- 13:41okay
- 13:42so for each of the process there
- 13:46okay so we have what you call a process
- 13:48control block so pcb which stores the
- 13:51following types of
- 13:54process specific information
- 13:56such as the process state
- 13:58the process number
- 13:59the program counter
- 14:01registers memory limits and the list of
- 14:04open files
- 14:05okay so the process state is basically
- 14:08the running waiting okay so we discussed
- 14:11in the previous slide
- 14:13okay
- 14:14so next would be
- 14:16the
- 14:17process number okay
- 14:20so
- 14:20the process number is basically the
- 14:22process id
- 14:24or the parent process id
- 14:26you also have the program counter
- 14:28okay so the program counter
- 14:30this needs to be saved and restored when
- 14:33swapping
- 14:35processes in and out of the cpu
- 14:37okay the location of
- 14:40the instruction
- 14:41next to execute
- 14:43okay
- 14:44next would be the cpu registers
- 14:47okay and
- 14:48[Music]
- 14:49that is the contents of all the process
- 14:51centric registers you've got the cpu
- 14:53scheduling information also
- 14:56so this includes the
- 14:58first in first out in case of the
- 15:00priorities if it is a round robin and
- 15:03other cpu scheduling algorithm
- 15:06all right so next would be the memory
- 15:08management information
- 15:10okay so example of this are page tables
- 15:13or segment tables so we will be
- 15:15discussing that in the
- 15:17latter chapter of this uh discussion or
- 15:20or of this book or of course okay
- 15:23so next one would be the accounting
- 15:24information
- 15:26it is a user and kernel cpu time
- 15:28consumed okay account numbers limits etc
- 15:32and the last one would be the i o status
- 15:34information so the devices allocated
- 15:37the open file tables etc
- 15:40okay
- 15:43next
- 15:44threads
- 15:45you have seen threads earlier on our
- 15:50task manager let me bring up again my
- 15:52task manager here okay
- 15:54so you'll see trends here now what is a
- 15:56trend so chat basically are some
- 15:58processes
- 16:00so take note that when you execute a
- 16:01process when you execute a program okay
- 16:04making it a process
- 16:06there are some processes associated with
- 16:09that main process and we call it trends
- 16:12okay so a good example of threads are
- 16:15the sub processes associated with
- 16:17microsoft word
- 16:19all right so let me open a microsoft
- 16:22word all right
- 16:26so win word let me open it
- 16:29so you'll see that on the taskbar i have
- 16:31opened microsoft word okay
- 16:34and see what happened to the number of
- 16:36threads here
- 16:38so it dramatically increases because
- 16:41inside that process or microsoft word
- 16:44process
- 16:45there are some processes there like a
- 16:47spell checker the grammar check
- 16:51letter counters word counters etc so
- 16:54these services are in the form of
- 16:56threads and we will be talking about
- 16:58threads
- 16:59in the next chapter of this presentation
- 17:03right or in the next chapter of the book
- 17:05let me close again that
- 17:07ms word
- 17:08all right
- 17:09so so far process has been a single
- 17:12thread of execution so consider having
- 17:14multiple program counters per process
- 17:17so you can have multiple threads of
- 17:19control
- 17:21right
- 17:22so we must have then a storage
- 17:25for thread details
- 17:26multiple program counters in
- 17:29the process control block or pcb
- 17:31okay again so we have a detailed
- 17:33discussion of threads on the next
- 17:36chapter of the course
- 17:38okay
- 17:41next so this is a
- 17:43process representation and linux okay
- 17:47so we're in the current process
- 17:50and currently executing processes in
- 17:52here okay
- 17:54you've got the stack task
- 17:56strap process information
- 17:58okay so this is how processes are
- 18:00represented in linux and this represents
- 18:04or represented by the c structure task
- 18:07strat
- 18:08okay so we will not be dealing with the
- 18:11os specific here so we just want to get
- 18:13into the operating system concepts that
- 18:16are applicable on any of the operating
- 18:19systems so well there are some features
- 18:21here that might be unique with the
- 18:23specific operating system
- 18:34[Music]
- 18:40foreign
About this transcript
This page contains the full transcript of 03 01 Processes Part 1 by Santelmo, generated from the public captions YouTube serves with the video. The transcript has 2,331 words across 480 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.