YouTube2Text

03 04 Processes Part 4 — Transcript

by Santelmo · 1,726 words · 387 segments · language en · Watch on YouTube

Full transcript

  1. 0:08[Music]
  2. 0:19so the process within a system may be
  3. 0:21independent or cooperating
  4. 0:24okay
  5. 0:25so when you say cooperating
  6. 0:27these are processed okay so it can
  7. 0:29affect or be affected by
  8. 0:32other processes including sharing data
  9. 0:35so the reasons for cooperating processes
  10. 0:37are information sharing computation
  11. 0:39speed up
  12. 0:40modularity and
  13. 0:42convenience okay so cooperating process
  14. 0:46needs the inter-process communication or
  15. 0:49ipc
  16. 0:50which
  17. 0:51are represented using the two models
  18. 0:54also which are the shared memory and
  19. 0:56the message passing
  20. 0:59okay
  21. 1:00now
  22. 1:01when you say independent process
  23. 1:03so operating concurrently on the systems
  24. 1:06are those that can neither
  25. 1:08affect other processes or be affected by
  26. 1:10the other processes as mentioned here
  27. 1:14okay
  28. 1:14now
  29. 1:15under three zones
  30. 1:17what is information sharing in operating
  31. 1:19process so there may be several
  32. 1:21processes which need access to the same
  33. 1:24file for example okay example are
  34. 1:27pipelines
  35. 1:28okay
  36. 1:29so computation speed up
  37. 1:32so often
  38. 1:33a solution to a problem can be solved
  39. 1:36faster if the problem can be broken down
  40. 1:38into sub tasks
  41. 1:41okay
  42. 1:42to be solved simultaneously so
  43. 1:43particularly when multiple processors
  44. 1:46are involved here
  45. 1:48okay
  46. 1:48modularity
  47. 1:50the most efficient architecture
  48. 1:53may be to break the system down into
  49. 1:55cooperating modules so example databases
  50. 1:58with a client server architecture
  51. 2:00okay and the last one would be
  52. 2:02convenience
  53. 2:03okay what is convenience in operating
  54. 2:06process
  55. 2:07so even a single user may be
  56. 2:10multitasking
  57. 2:11such as editing compiling printing and
  58. 2:13running at the same code
  59. 2:15in different windows so that's
  60. 2:17convenience
  61. 2:19okay
  62. 2:20now let's see the model mentioned here
  63. 2:22the shared and the message passing
  64. 2:26okay
  65. 2:27now cooperating process requires some
  66. 2:31uh type of the inter-process
  67. 2:33communication which is mostly one of
  68. 2:36these two okay the shared memory
  69. 2:39or the message passing systems
  70. 2:42okay now is the difference between these
  71. 2:44two
  72. 2:45when you say shared memory this is
  73. 2:47faster once
  74. 2:49it is set up
  75. 2:50so because no system calls are required
  76. 2:53and access occurs at a normal memory
  77. 2:55speeds
  78. 2:56so however
  79. 2:58it is more complicated to set up and it
  80. 3:01doesn't work as well across multiple
  81. 3:04computers
  82. 3:05so shared memory is generally preferable
  83. 3:08when large amounts of information
  84. 3:10must be shared quickly
  85. 3:12on the same computer
  86. 3:14okay
  87. 3:16now for the message passing it requires
  88. 3:18system calls for every message transfer
  89. 3:21okay
  90. 3:23and it's therefore slower but it is
  91. 3:25simpler to set up and works well with
  92. 3:29multiple computers or across multiple
  93. 3:31computers
  94. 3:32so message passing is generally
  95. 3:34preferable
  96. 3:35when the amount and or frequency of data
  97. 3:38transfer is small
  98. 3:39or when multiple computers are involved
  99. 3:43okay so that is when the message passing
  100. 3:46is
  101. 3:48useful
  102. 3:50okay
  103. 3:52next
  104. 3:53let's talk about the producer consumer
  105. 3:55problem
  106. 3:56okay so the paradigm for operating
  107. 3:59process
  108. 4:01so the producer process
  109. 4:04produces information
  110. 4:05that is consumed by the consumer process
  111. 4:09so there are two variations here okay
  112. 4:11it could be the unbounded proper a
  113. 4:14buffer or the bounded buffer
  114. 4:17okay
  115. 4:18so for these two variations when you say
  116. 4:20unbounded buffer
  117. 4:22there is no practical limit on the size
  118. 4:24of the buffer
  119. 4:25so the producer never waits and the
  120. 4:28consumer waits if there is no buffer to
  121. 4:31consume
  122. 4:33okay
  123. 4:35on the bounded buffer
  124. 4:37it assumes that there is a fixed buffer
  125. 4:39size so the producer must wait if all
  126. 4:42buffers are full
  127. 4:44the consumer wage if there is no buffer
  128. 4:47to consume
  129. 4:48so this is a classic example
  130. 4:51in which one process is producing data
  131. 4:54and another process is consuming data
  132. 4:58okay
  133. 5:00so
  134. 5:01in this example in the order in which it
  135. 5:03is produced although
  136. 5:05that could vary okay so the data is
  137. 5:08passed via an intermediary buffer
  138. 5:11which may be either
  139. 5:13bounded
  140. 5:15or unbounded
  141. 5:16okay so with bounded buffer the producer
  142. 5:19may have to wait until there is a space
  143. 5:22available
  144. 5:24okay but when
  145. 5:26an unbounded buffer the producer the
  146. 5:29producer will never need to wait
  147. 5:32okay so the consumer may need to wait in
  148. 5:35either case until there is a data
  149. 5:37available
  150. 5:39okay so that is producer
  151. 5:41consumer problem
  152. 5:44okay so we will be using this
  153. 5:46producer consumer problem on the
  154. 5:49discussion of deadlocks
  155. 5:52okay
  156. 5:54now the inter-process communication for
  157. 5:55the shared memory okay so an area of
  158. 5:59memory shared among the process that
  159. 6:01wish to communicate so the communication
  160. 6:04is under the control of the users
  161. 6:06okay
  162. 6:07major issues to provide mechanisms that
  163. 6:10will allow the user processes
  164. 6:12to synchronize their action when they
  165. 6:14access shared memory
  166. 6:16so synchronization is discussed in great
  167. 6:19details in chapter six and seven
  168. 6:22right
  169. 6:24next
  170. 6:26how about the bounded buffer the shared
  171. 6:28memory solution so this example uses a
  172. 6:30shared memory and circular queue so note
  173. 6:34in the code okay
  174. 6:37that only the producer changes in
  175. 6:41okay and only the consumer changes out
  176. 6:46okay
  177. 6:47so and they can never be accessing the
  178. 6:49same array location at the same time so
  179. 6:52first the following data is set up
  180. 6:55in the shared memory area
  181. 6:58okay so the solution is correct but it
  182. 7:02can
  183. 7:03only use a buffer size -1 elements
  184. 7:07okay
  185. 7:10next
  186. 7:12then the producer process
  187. 7:15note that the buffer is full when in
  188. 7:18is one less than out in circular sense
  189. 7:23okay
  190. 7:27next
  191. 7:28the consumer process note that the
  192. 7:30buffer is empty
  193. 7:32when in is equal to out
  194. 7:35okay
  195. 7:36so
  196. 7:37[Music]
  197. 7:39next
  198. 7:40what about filling all the buffers would
  199. 7:42that be possible okay so so suppose that
  200. 7:45we wanted to provide a solution to the
  201. 7:47consumer producer problem that fills
  202. 7:51all the buffers
  203. 7:53what can we do so
  204. 7:55or we can do so by having an integer
  205. 7:57counter that keeps track
  206. 7:59of the number of full buffers so
  207. 8:01initially the counter is set to zero
  208. 8:03the integer counter is incremented by
  209. 8:05the producer after it produces a new
  210. 8:07buffer
  211. 8:09and the integer counter is and is
  212. 8:11decremented by the consumer after it
  213. 8:13consumes the buffer
  214. 8:16okay
  215. 8:18so you'll have this
  216. 8:20produce an item in the next
  217. 8:22produced
  218. 8:24this is for the producer
  219. 8:26okay
  220. 8:27and for the consumer
  221. 8:30you'll have this so if there is a
  222. 8:33resource available then it needs to be
  223. 8:35consumed
  224. 8:36okay
  225. 8:37so the next one would be the race
  226. 8:39condition so what is a race condition
  227. 8:42any time there is or there are two armor
  228. 8:44processors or threads operating on
  229. 8:46currently
  230. 8:48there is a potential for a particularly
  231. 8:50difficult class of problems
  232. 8:53we call it race condition
  233. 8:56okay
  234. 8:57so the identifying characteristics of
  235. 8:59phrase conditions is that the
  236. 9:01performance varies depending on which
  237. 9:04process or thread executes their
  238. 9:06instructions
  239. 9:07before
  240. 9:08the other one and this becomes a problem
  241. 9:12when the program runs correctly in some
  242. 9:14instance and incorrectly in others
  243. 9:17okay so race conditions are notoriously
  244. 9:20difficult to debug because they are
  245. 9:22unpredictable
  246. 9:24and repeatable and may not exhibit
  247. 9:26themselves for years
  248. 9:29okay
  249. 9:36okay so
  250. 9:37next
  251. 9:38note that the above solution also checks
  252. 9:40the return value from
  253. 9:42the read system call so to verify the
  254. 9:45number of characters
  255. 9:47read is equal to the number expected
  256. 9:50okay
  257. 9:51some of those checks were actually in
  258. 9:52the original code but
  259. 9:55they were omitted from the nodes for
  260. 9:57clarity okay
  261. 9:59and the real code also uses select
  262. 10:02before reading
  263. 10:04okay so to verify
  264. 10:06that there are characters present to
  265. 10:08read
  266. 10:10and to delay if not
  267. 10:12okay
  268. 10:13so note also that this problem could not
  269. 10:16be easily solved using synchronization
  270. 10:19tools
  271. 10:20that we're going to discuss in chapter
  272. 10:22six because the problem is not really
  273. 10:25one of two processes accessing the same
  274. 10:27data at the same time
  275. 10:30okay so these problems here about
  276. 10:33synchronization will be discussed in
  277. 10:35detail and thoroughly on the next
  278. 10:38few chapters the next two chapters okay
  279. 10:41specifically
  280. 10:44okay so next would be the
  281. 10:47inter-process communication the message
  282. 10:49passing
  283. 10:50message passing systems must support a
  284. 10:52minimum system calls for send
  285. 10:54message and receive message
  286. 10:57so you'll have this
  287. 10:58all right so these are the ipc facility
  288. 11:02operations
  289. 11:04okay
  290. 11:05so process communicate with each other
  291. 11:07without resorting to shared variables
  292. 11:10okay so the message size is either fixed
  293. 11:13or
  294. 11:14variable
  295. 11:18okay
  296. 11:19so a communication link okay so take
  297. 11:21note that we have your established
  298. 11:23communication link okay so a
  299. 11:25communication link must be established
  300. 11:27between the operating processes
  301. 11:30before messages can be sent
  302. 11:33so there are three key issues to be
  303. 11:35resolved in message passing systems as
  304. 11:38further explored in the next three
  305. 11:40subsections okay so we have the direct
  306. 11:43or indirect communications
  307. 11:45naming
  308. 11:46synchronous or asynchronous
  309. 11:48communication and automatic or
  310. 11:51explicit buffering
  311. 11:53okay so this summarizes this issues here
  312. 11:58now let's talk about the implementations
  313. 12:01of the communication link
  314. 12:02so it's either implemented in physical
  315. 12:05or logical
  316. 12:06okay in physical
  317. 12:08we have the shared memory the hardware
  318. 12:10bus and the network
  319. 12:12implementation
  320. 12:13logically we could have direct or
  321. 12:15indirect
  322. 12:16synchronous or asynchronous and
  323. 12:19automatic or explicit buffering
  324. 12:22okay now
  325. 12:24with direct communication
  326. 12:27okay the sender must know the name of
  327. 12:29the receiver to which it wishes to send
  328. 12:33message
  329. 12:34so for symmetric communication the
  330. 12:36receiver must also know the specific
  331. 12:39name of the sender
  332. 12:40from which it wishes to receive messages
  333. 12:44well for us asymmetric
  334. 12:47there is or this is not necessary
  335. 12:51okay
  336. 12:53now for indirect communications all
  337. 12:56right so indirect communication uses
  338. 12:59shared mailboxes
  339. 13:00or ports all right
  340. 13:04so
  341. 13:05multiple processes
  342. 13:07can share
  343. 13:08that
  344. 13:09mailbox or boxes
  345. 13:12so only one process can read any given
  346. 13:15message in a mailbox so initially
  347. 13:18process that creates the mailbox is the
  348. 13:20owner
  349. 13:21and is the only one allowed to read mail
  350. 13:24in that mailbox although
  351. 13:27this privilege may be transferred
  352. 13:29okay
  353. 13:31so of course
  354. 13:32the process that reads the message can
  355. 13:34immediately turn around and place an
  356. 13:36identical message back in the box for
  357. 13:38someone else to read
  358. 13:40but that may put it
  359. 13:42at the back end of the queue messages
  360. 13:46okay so the os provides system calls to
  361. 13:49create and delete mailboxes and to send
  362. 13:51and receive messages to or from
  363. 13:53the mailboxes
  364. 13:56all right so that's indirect
  365. 13:57communication
  366. 14:00okay so this is what i mentioned earlier
  367. 14:05now
  368. 14:08next is
  369. 14:10how about mailbox sharing
  370. 14:11as mentioned earlier for example you've
  371. 14:13got p1 p2 and p3 shear mailbox a so p1
  372. 14:18sends p2 and p3 receive who gets the
  373. 14:21message
  374. 14:23okay
  375. 14:24so solution would be
  376. 14:26allow a link to be associated with most
  377. 14:28or at most two processes
  378. 14:31allow only one process at the time to
  379. 14:33execute a receive operation
  380. 14:37allow the system to select arbitrarily
  381. 14:40the receiver
  382. 14:41sender is not or is notified who the
  383. 14:44receiver was
  384. 14:46okay that's indirect
  385. 14:48communication
  386. 14:58[Music]
  387. 15:06you

About this transcript

This page contains the full transcript of 03 04 Processes Part 4 by Santelmo, generated from the public captions YouTube serves with the video. The transcript has 1,726 words across 387 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.