YouTube2Text

03 01 Processes Part 1 — Transcript

by Santelmo · 2,331 words · 480 segments · language en · Watch on YouTube

Full transcript

  1. 0:08[Music]
  2. 0:20hi good day
  3. 0:23on this video lecture
  4. 0:24so we are going to cover discussions on
  5. 0:29operating system processes
  6. 0:33so here's the outline of the
  7. 0:36presentation so we are going to deal
  8. 0:38with the following
  9. 0:40so you've got a process concept
  10. 0:43process scheduling
  11. 0:45operations on processes
  12. 0:48the inter-process communication
  13. 0:51ipc or the inter-process communication
  14. 0:53and shared memory systems
  15. 0:56the inter-process communication in
  16. 0:58message passing systems
  17. 1:01so we also deal with examples of the
  18. 1:03inter-process communication systems
  19. 1:06and the communication in the client
  20. 1:08server systems
  21. 1:13all right
  22. 1:14so the objective of our video or
  23. 1:17objectives of the video so would be the
  24. 1:19following so first
  25. 1:21identify the separate components of a
  26. 1:24process and illustrate how they are
  27. 1:26represented and scheduled in an
  28. 1:28operating system
  29. 1:30okay so second is describe how
  30. 1:32processors are created and terminated in
  31. 1:34an operating system so including
  32. 1:37developing programs using the
  33. 1:39appropriate system calls
  34. 1:41that perform these operations
  35. 1:44okay so third is to describe
  36. 1:48and contrast the inter-process
  37. 1:50communication using
  38. 1:52shared memory and message passing
  39. 1:56forties design programs that uses pipes
  40. 1:59and posix shared memory to perform the
  41. 2:02inter-process communication or ipc
  42. 2:06so to describe the client server
  43. 2:07communication using sockets and remote
  44. 2:10procedure calls
  45. 2:11right and last would be to design kernel
  46. 2:14modules that interact with the linux
  47. 2:16operating systems
  48. 2:19so let's start
  49. 2:21so let's start with the definition of a
  50. 2:23process so what is a process
  51. 2:26in an operating systems
  52. 2:29okay so basically when you say process
  53. 2:31we're talking about the instance of
  54. 2:32program execution
  55. 2:35okay a process is basically
  56. 2:37a program in
  57. 2:39execution
  58. 2:40so process execution must progress in
  59. 2:43sequential fashion
  60. 2:45no parallel execution of instructions of
  61. 2:48a single process
  62. 2:49so basically in layman's term when say
  63. 2:52process
  64. 2:54we run the program it creates a process
  65. 2:57the program itself that is not running
  66. 2:59is not considered to be a process so you
  67. 3:02run the applications and that would
  68. 3:04become a process
  69. 3:06okay
  70. 3:07so batch systems works in terms of jobs
  71. 3:10so on this discussion
  72. 3:13the process or the term process and jobs
  73. 3:15are used interchangeably
  74. 3:17so process is also the same as jobs and
  75. 3:20we talk about a program in
  76. 3:22execution
  77. 3:24okay
  78. 3:25so many many modern process concepts are
  79. 3:28still expressed in terms of jobs
  80. 3:30that's why some books you'll be hearing
  81. 3:32job scheduling
  82. 3:34okay
  83. 3:35or that is also the same with process
  84. 3:37scheduling or we call it cpu scheduling
  85. 3:40okay so these terms are used
  86. 3:42interchangeably throughout the
  87. 3:44discussion here okay
  88. 3:46so a process basically composed of
  89. 3:49multiple parts
  90. 3:51okay so you've got the program code
  91. 3:54also called the text section
  92. 3:57so currently our current activity
  93. 3:59including the program counter processor
  94. 4:02registers okay
  95. 4:03so stack containing the temporal data
  96. 4:06so function parameters return addresses
  97. 4:09and local variables
  98. 4:11so you also have data section containing
  99. 4:14the global variables and the heap
  100. 4:16containing memory dynamically allocated
  101. 4:19during runtime
  102. 4:25okay so a program is either passive or
  103. 4:29active okay so program is passive entity
  104. 4:33stored on the disk
  105. 4:34this or the executable file
  106. 4:37okay and when you say process we're
  107. 4:40talking about the active
  108. 4:42okay active program or running program
  109. 4:45so that is what we call a process okay
  110. 4:48so program becomes a process
  111. 4:51only when an executable file is loaded
  112. 4:53into the memory
  113. 4:54and being executed by the cpu
  114. 4:57okay so execution of programs started
  115. 5:00via gui okay so via mouse click so take
  116. 5:04note that when you click on the
  117. 5:05application you are actually starting a
  118. 5:07process
  119. 5:08okay or in the command line you simply
  120. 5:11type in the command okay so just make
  121. 5:13sure it is executable and that creates a
  122. 5:15process
  123. 5:17right so one program can have
  124. 5:20several processes
  125. 5:22consider multiple users executing the
  126. 5:24same program
  127. 5:26okay
  128. 5:28next
  129. 5:29so this diagram here represents a
  130. 5:32process in a memory
  131. 5:34okay so basically as mentioned earlier a
  132. 5:37process has the following so it has a
  133. 5:39stack
  134. 5:40heap
  135. 5:41data and text
  136. 5:44okay so process memory is divided into
  137. 5:47this four section as you can see here
  138. 5:50you've got to stop the heap the data and
  139. 5:52the text
  140. 5:53so let's start with a text section
  141. 5:56okay so the text section comprises the
  142. 5:58compiled program code
  143. 6:00read in from a non-volatile storage when
  144. 6:03the program is launched
  145. 6:06okay
  146. 6:07so the next one is data section it
  147. 6:09stores global and static variables
  148. 6:11allocated and initialized prior to
  149. 6:13executing the main
  150. 6:15function in a program
  151. 6:16okay so that's why
  152. 6:18for example in c plus we'll have the
  153. 6:20main function
  154. 6:22okay
  155. 6:24next is the hip
  156. 6:26okay
  157. 6:27so what is a hip hip is used for dynamic
  158. 6:29memory allocation
  159. 6:31and is managed by a calls to new delete
  160. 6:35the malloc or the memory allocation
  161. 6:39free and i recommend etc
  162. 6:42okay
  163. 6:43so the next one is stack so stack is
  164. 6:45used for local variables so space on the
  165. 6:48stock is reserved for local variables
  166. 6:51when they are declared okay at the
  167. 6:54function entrance
  168. 6:55or maybe elsewhere depending on the
  169. 6:57language
  170. 6:58all right and the space is freed up when
  171. 7:01the variables go out of the scope
  172. 7:04okay so note that the stock is also used
  173. 7:07for function return values
  174. 7:09and the exact mechanism of stock
  175. 7:11management
  176. 7:12may be language specific
  177. 7:14so maybe you are
  178. 7:16you you still remember
  179. 7:18okay so programming
  180. 7:20all right
  181. 7:21so we have declaration of the local and
  182. 7:24global variables in there so that works
  183. 7:26on
  184. 7:27the sub
  185. 7:29okay so note that the stock and the heap
  186. 7:32start at opposite ends of the process
  187. 7:34free space
  188. 7:35and grow towards each other so you'll
  189. 7:37have the space here
  190. 7:39okay
  191. 7:42and if they should ever meet
  192. 7:44then either the stock overflow error
  193. 7:46will occur
  194. 7:48okay else a call to a new or memory
  195. 7:51allocation or malloc
  196. 7:52will fail due to insufficient memory
  197. 7:55available
  198. 7:56okay so when a process are swapped out
  199. 8:00of the memory and later is stored
  200. 8:02additional information must also be
  201. 8:04stored
  202. 8:06and restored
  203. 8:07so key among them are the program
  204. 8:10counter
  205. 8:11and the value of all the program
  206. 8:12registers
  207. 8:14all right
  208. 8:16next so i have here an example of a
  209. 8:19memory layout of a c program
  210. 8:21so this is what uh what has been
  211. 8:23explained
  212. 8:24on the previous slides or in
  213. 8:26every time you declare variables so
  214. 8:29every time we
  215. 8:31we declare an identifier so they are
  216. 8:33mapped into the memory
  217. 8:36okay so the lower portion of memory is
  218. 8:38the text so what you call the text and
  219. 8:41these variables here
  220. 8:43are occupying the other portions of the
  221. 8:46memory
  222. 8:48all right
  223. 8:49now so
  224. 8:51when you say process as i said earlier
  225. 8:54this is a program and execution
  226. 8:56okay so if we are talking about the
  227. 9:01processes of this computer let me show
  228. 9:03you that okay so let me open
  229. 9:05a task manager here okay
  230. 9:08so
  231. 9:10this task manager here okay shows the
  232. 9:13number of processors running so
  233. 9:15basically they are represented by
  234. 9:18apps okay
  235. 9:19you've got the user processors here and
  236. 9:22i also have
  237. 9:23here some background processes
  238. 9:26all right
  239. 9:27now in here you will observe the
  240. 9:30allocation of the resources
  241. 9:32all right
  242. 9:33so for the allocation of the resources
  243. 9:35so basically your operating system
  244. 9:37allocates
  245. 9:39the cpu
  246. 9:41currently i'm using 20 of it the memory
  247. 9:44disk network and others
  248. 9:47now what i want you to pay attention
  249. 9:49with is the performance here
  250. 9:52and take a look at the number of
  251. 9:53processes
  252. 9:55which are being run by this computer
  253. 9:58okay so let me expand this
  254. 10:01so we've got processes here okay and
  255. 10:04then performance
  256. 10:07all right
  257. 10:08so
  258. 10:10these are the resources available on the
  259. 10:12cpu when you click on the cpu you'll
  260. 10:15have the processes there
  261. 10:17right
  262. 10:18so currently this computer is running
  263. 10:21170 processes but
  264. 10:23if you will observe you will only see
  265. 10:25some of the processes here
  266. 10:27because majority of the processes being
  267. 10:30run by your computer is part of the
  268. 10:31system or part of the operating system
  269. 10:34all right
  270. 10:35so
  271. 10:36again we have processes here that means
  272. 10:38this computer is running
  273. 10:41170 program at the current state
  274. 10:45okay and there are about 2
  275. 10:48370 plus plus
  276. 10:50threads
  277. 10:52okay
  278. 10:53now let's talk about the process state
  279. 10:56okay so each process each application we
  280. 10:58open and run passes through this
  281. 11:02state
  282. 11:02okay so basically we're going to start
  283. 11:05with new
  284. 11:06new is when the process is created
  285. 11:10running
  286. 11:11instructions are being executed
  287. 11:14waiting the process is waiting for some
  288. 11:16event to occur
  289. 11:18you've got already
  290. 11:21the process is waiting to be assigned to
  291. 11:23a processor and terminated the process
  292. 11:25has finished the execution
  293. 11:27okay so representing in terms of a
  294. 11:29diagram here so this represents the
  295. 11:31process state so initially when you open
  296. 11:34the application we are actually creating
  297. 11:37a new process
  298. 11:39okay
  299. 11:40the process is in the stage
  300. 11:43of being created so that's what we meant
  301. 11:45by news
  302. 11:47okay
  303. 11:48and then once admitted onto the memory
  304. 11:51so it will now be in red state
  305. 11:54so ready means the process has all the
  306. 11:56resources available that it needs
  307. 11:58to run but the cpu is not currently
  308. 12:01working on its process instructions
  309. 12:03so basically before we run an
  310. 12:05application before it is considered to
  311. 12:08be a process
  312. 12:09this application needs resources or this
  313. 12:12process needs resources
  314. 12:15okay
  315. 12:15and once it has the resources so it is
  316. 12:18now in ready state
  317. 12:20okay
  318. 12:21next state is running
  319. 12:23so after the ready state so you've got
  320. 12:25the running state there the cpu is
  321. 12:27working on its
  322. 12:29process instructions now
  323. 12:32and then waiting here
  324. 12:35waiting is caused by an io or an event
  325. 12:37rate
  326. 12:38okay
  327. 12:40or an i o completion so and then that
  328. 12:43would go to ready and then running again
  329. 12:46now waiting is the process cannot run at
  330. 12:49the moment
  331. 12:50because it is waiting for some resource
  332. 12:52to become available
  333. 12:54or for some events occur so for example
  334. 12:57the process
  335. 12:59may be waiting for a keyboard input
  336. 13:01or disk access request or enter process
  337. 13:05messages okay a timer go off
  338. 13:08or
  339. 13:09a child process to finish
  340. 13:11so that is waiting state
  341. 13:14all right
  342. 13:15so next would be
  343. 13:17terminated so the process has completed
  344. 13:20its operation
  345. 13:23all right
  346. 13:24next
  347. 13:26now let's talk about the process control
  348. 13:28block
  349. 13:29okay so what is a process control block
  350. 13:32so it has the information associated
  351. 13:35with each process
  352. 13:36this is also called the task control
  353. 13:38block or tcb
  354. 13:41okay
  355. 13:42so for each of the process there
  356. 13:46okay so we have what you call a process
  357. 13:48control block so pcb which stores the
  358. 13:51following types of
  359. 13:54process specific information
  360. 13:56such as the process state
  361. 13:58the process number
  362. 13:59the program counter
  363. 14:01registers memory limits and the list of
  364. 14:04open files
  365. 14:05okay so the process state is basically
  366. 14:08the running waiting okay so we discussed
  367. 14:11in the previous slide
  368. 14:13okay
  369. 14:14so next would be
  370. 14:16the
  371. 14:17process number okay
  372. 14:20so
  373. 14:20the process number is basically the
  374. 14:22process id
  375. 14:24or the parent process id
  376. 14:26you also have the program counter
  377. 14:28okay so the program counter
  378. 14:30this needs to be saved and restored when
  379. 14:33swapping
  380. 14:35processes in and out of the cpu
  381. 14:37okay the location of
  382. 14:40the instruction
  383. 14:41next to execute
  384. 14:43okay
  385. 14:44next would be the cpu registers
  386. 14:47okay and
  387. 14:48[Music]
  388. 14:49that is the contents of all the process
  389. 14:51centric registers you've got the cpu
  390. 14:53scheduling information also
  391. 14:56so this includes the
  392. 14:58first in first out in case of the
  393. 15:00priorities if it is a round robin and
  394. 15:03other cpu scheduling algorithm
  395. 15:06all right so next would be the memory
  396. 15:08management information
  397. 15:10okay so example of this are page tables
  398. 15:13or segment tables so we will be
  399. 15:15discussing that in the
  400. 15:17latter chapter of this uh discussion or
  401. 15:20or of this book or of course okay
  402. 15:23so next one would be the accounting
  403. 15:24information
  404. 15:26it is a user and kernel cpu time
  405. 15:28consumed okay account numbers limits etc
  406. 15:32and the last one would be the i o status
  407. 15:34information so the devices allocated
  408. 15:37the open file tables etc
  409. 15:40okay
  410. 15:43next
  411. 15:44threads
  412. 15:45you have seen threads earlier on our
  413. 15:50task manager let me bring up again my
  414. 15:52task manager here okay
  415. 15:54so you'll see trends here now what is a
  416. 15:56trend so chat basically are some
  417. 15:58processes
  418. 16:00so take note that when you execute a
  419. 16:01process when you execute a program okay
  420. 16:04making it a process
  421. 16:06there are some processes associated with
  422. 16:09that main process and we call it trends
  423. 16:12okay so a good example of threads are
  424. 16:15the sub processes associated with
  425. 16:17microsoft word
  426. 16:19all right so let me open a microsoft
  427. 16:22word all right
  428. 16:26so win word let me open it
  429. 16:29so you'll see that on the taskbar i have
  430. 16:31opened microsoft word okay
  431. 16:34and see what happened to the number of
  432. 16:36threads here
  433. 16:38so it dramatically increases because
  434. 16:41inside that process or microsoft word
  435. 16:44process
  436. 16:45there are some processes there like a
  437. 16:47spell checker the grammar check
  438. 16:51letter counters word counters etc so
  439. 16:54these services are in the form of
  440. 16:56threads and we will be talking about
  441. 16:58threads
  442. 16:59in the next chapter of this presentation
  443. 17:03right or in the next chapter of the book
  444. 17:05let me close again that
  445. 17:07ms word
  446. 17:08all right
  447. 17:09so so far process has been a single
  448. 17:12thread of execution so consider having
  449. 17:14multiple program counters per process
  450. 17:17so you can have multiple threads of
  451. 17:19control
  452. 17:21right
  453. 17:22so we must have then a storage
  454. 17:25for thread details
  455. 17:26multiple program counters in
  456. 17:29the process control block or pcb
  457. 17:31okay again so we have a detailed
  458. 17:33discussion of threads on the next
  459. 17:36chapter of the course
  460. 17:38okay
  461. 17:41next so this is a
  462. 17:43process representation and linux okay
  463. 17:47so we're in the current process
  464. 17:50and currently executing processes in
  465. 17:52here okay
  466. 17:54you've got the stack task
  467. 17:56strap process information
  468. 17:58okay so this is how processes are
  469. 18:00represented in linux and this represents
  470. 18:04or represented by the c structure task
  471. 18:07strat
  472. 18:08okay so we will not be dealing with the
  473. 18:11os specific here so we just want to get
  474. 18:13into the operating system concepts that
  475. 18:16are applicable on any of the operating
  476. 18:19systems so well there are some features
  477. 18:21here that might be unique with the
  478. 18:23specific operating system
  479. 18:34[Music]
  480. 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.